nodemon: not found

56 views
Skip to first unread message

studio...@gmail.com

unread,
Jan 14, 2020, 10:10:24 PM1/14/20
to NodeChef
Hi,
I'm new to NodeChef, and am trying to upload a basic Node.js API,
However I'm running into an issue where the required node modules don't seem to be found despite being in the package.json and it looks like their getting installed on build.
The app runs fine locally.
Here is the build log


Status log

 (!) Error:     /bundle/__ncs__.sh: line 3: npm: command not found
    /bundle/__ncs__.sh: line 5: npm: command not found
    /bundle/__ncs__.sh: line 7: npm: command not found
    /bundle/__ncs__.sh: line 9: npm: command not found
    /bundle/__ncs__.sh: line 10: npm: command not found
    
    > tavernt...@1.0.0 start /bundle/__ncapphome__
    > nodemon server.js
    
    sh: 1: nodemon: not found
    npm ERR! code ELIFECYCLE
    npm ERR! syscall spawn
    npm ERR! file sh
    npm ERR! errno ENOENT
    npm ERR! tavernt...@1.0.0 start: `nodemon server.js`
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the tavernt...@1.0.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR! /bundle/__ncapphome__/.npm/_logs/2020-01-15T00_15_53_247Z-debug.log
 -----> Abandon deployment because of error - Please read logs
 ----->
 -----> (!) Error:     /bundle/__ncs__.sh: line 3: npm: command not found
    /bundle/__ncs__.sh: line 5: npm: command not found
    /bundle/__ncs__.sh: line 7: npm: command not found
    /bundle/__ncs__.sh: line 9: npm: command not found
    /bundle/__ncs__.sh: line 10: npm: command not found
    
    > tavernt...@1.0.0 start /bundle/__ncapphome__
    > nodemon server.js
    
    sh: 1: nodemon: not found
    npm ERR! code ELIFECYCLE
    npm ERR! syscall spawn
    npm ERR! file sh
    npm ERR! errno ENOENT
    npm ERR! tavernt...@1.0.0 start: `nodemon server.js`
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the tavernt...@1.0.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR! /bundle/__ncapphome__/.npm/_logs/2020-01-15T00_15_53_247Z-debug.log
 ----->
 -----> Log output from container
 -----> Container is down and not running - Abandon deployment - Exit code (1)
 -----> Container not ready - Check if it is still running
 -----> Will poll for about a 30 seconds before committing updates
 -----> Must await for new container to start listening on assigned port (2487)
 -----> Configuring database connection strings
 -----> buildpack--nc-heroku-buildpack-nodejs completed with exit(0)
 -----> Build succeeded!


 found 0 vulnerabilities

 run `npm fund` for details
 1 package is looking for funding

 removed 102 packages and audited 152 packages in 2.835s
 -----> Pruning devDependencies

 - node_modules
 -----> Caching build

 -----> Build


 found 0 vulnerabilities

 run `npm fund` for details
 2 packages are looking for funding

 added 182 packages from 89 contributors and audited 293 packages in 10.477s

 > [96m [1mhttps://opencollective.com/nodemon/donate [0m
  [32mLove nodemon? You can now support the project via the open collective: [22m [39m

 > node bin/postinstall || exit 0
 > nod...@2.0.2 postinstall /bundle/__ncapphome__/node_modules/nodemon

 Installing node modules (package.json + package-lock)
 -----> Installing dependencies

 Module installation may take longer for this build
 Cached directories were not restored due to a change in version of node, npm, yarn or stack
 -----> Restoring cache

 Using default npm version: 6.13.4
 Downloading and installing node 12.14.1...
 Resolving node version 12.x...

 engines.npm (package.json): unspecified (use default)
 engines.node (package.json): unspecified
 -----> Installing binaries

 NODE_MODULES_CACHE=true
 NODE_ENV=production
 NODE_VERBOSE=false
 NPM_CONFIG_LOGLEVEL=error

 -----> Creating runtime environment

 -----> PWD: /bundle/buildpack--nc-heroku-buildpack-nodejs/bin
 -----> Cloning into '.'...
 -----> Uploading bundle to container host (1)
 -----> Received application package at deployment bridge
 -----> Receiving application
 -----> Total container hosts: 1
 Container host (1) responded with ok
 Send environment variables to container host (1) and await response
 Deploy with environment variables: {
"ROOT_URL" : "http://taverntalesgame.com/"
}
 -----> Upload  [================================================================]  100%

in...@nodechef.com

unread,
Jan 14, 2020, 10:20:32 PM1/14/20
to NodeChef
You should change your start script to "node server.js" instead of nodemon server.js" and that should work. 

The nodemon binary wont be in the PATH variable after it is installed downloaded to the node_modules folder. nodemon works locally because it is installed with the -g flag. nodemon simply is a process manager that starts your process and does auto restarts, NodeChef does this out of the box already.

Hope this helps.

in...@nodechef.com

unread,
Jan 14, 2020, 11:00:48 PM1/14/20
to NodeChef
In case you still want to use nodemon, make sure nodemon is a listed under dependencies and not devdependencies. This allows you to keep your start script as is and not have to change how you start things locally.
Reply all
Reply to author
Forward
0 new messages