I’m trying to deploy my project which is an api, and I keep having this errors
Mar 6 08:52:30 PM npm ERR! Exit status 1
Mar 6 08:52:30 PM npm ERR!
Mar 6 08:52:30 PM npm ERR! Failed at the server@1.0.0 server script.
Mar 6 08:52:30 PM npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Mar 6 09:01:55 PM ==> Cloning from GitHub - AugustoBarcelos/ShirtShop…
Mar 6 09:01:56 PM ==> Checking out commit afc771e4407457d4037bdd358a78d9d6c6ee8b45 in branch main
Mar 6 09:02:00 PM ==> Running build command ‘npm build’…
Mar 6 09:02:00 PM ==> Generating container image from build. This may take a few minutes…
Mar 6 09:03:05 PM ==> Uploading build…
Mar 6 09:03:31 PM ==> Build uploaded in 21s
Mar 6 09:03:32 PM ==> Build successful
Mar 6 09:03:32 PM ==> Deploying…
Mar 6 09:03:46 PM ==> Starting service with ‘npm run server’
Mar 6 09:03:49 PM
Mar 6 09:03:49 PM > server@1.0.0 server /opt/render/project/src/server
Mar 6 09:03:49 PM > nodemon node ./server.js
Mar 6 09:03:49 PM
Mar 6 09:03:49 PM sh: 1: nodemon: not found
Mar 6 09:03:49 PM npm ERR! code ELIFECYCLE
Mar 6 09:03:49 PM npm ERR! syscall spawn
Mar 6 09:03:49 PM npm ERR! file sh
Mar 6 09:03:49 PM npm ERR! errno ENOENT
Mar 6 09:03:49 PM npm ERR! server@1.0.0 server: nodemon node ./server.js
Mar 6 09:03:49 PM npm ERR! spawn ENOENT
Mar 6 09:03:49 PM npm ERR!
Mar 6 09:03:49 PM npm ERR! Failed at the server@1.0.0 server script.
Mar 6 09:03:49 PM npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Mar 6 09:03:49 PM
Mar 6 09:03:49 PM npm ERR! A complete log of this run can be found in:
Mar 6 09:03:49 PM npm ERR! /opt/render/.cache/_logs/2023-03-07T00_03_49_499Z-debug.log
Mar 6 09:03:57 PM ==> Starting service with ‘npm run server’
Mar 6 09:04:00 PM
Mar 6 09:04:00 PM > server@1.0.0 server /opt/render/project/src/server
Mar 6 09:04:00 PM > nodemon node ./server.js
Mar 6 09:04:00 PM
Mar 6 09:04:00 PM sh: 1: nodemon: not found
Mar 6 09:04:00 PM npm ERR! code ELIFECYCLE
Mar 6 09:04:00 PM npm ERR! syscall spawn
Mar 6 09:04:00 PM npm ERR! file sh
Mar 6 09:04:00 PM npm ERR! errno ENOENT
Mar 6 09:04:00 PM npm ERR! server@1.0.0 server: nodemon node ./server.js
Mar 6 09:04:00 PM npm ERR! spawn ENOENT
Mar 6 09:04:00 PM npm ERR!
Mar 6 09:04:00 PM npm ERR! Failed at the server@1.0.0 server script.
Mar 6 09:04:00 PM npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Mar 6 09:04:00 PM
Mar 6 09:04:00 PM npm ERR! A complete log of this run can be found in:
Mar 6 09:04:00 PM npm ERR! /opt/render/.cache/_logs/2023-03-07T00_04_00_413Z-debug.log
Mar 6 09:04:28 PM ==> Starting service with ‘npm run server’
Mar 6 09:04:31 PM
Mar 6 09:04:31 PM > server@1.0.0 server /opt/render/project/src/server
Mar 6 09:04:31 PM > nodemon node ./server.js
Mar 6 09:04:31 PM
Mar 6 09:04:31 PM sh: 1: nodemon: not found
Mar 6 09:04:31 PM npm ERR! code ELIFECYCLE
Mar 6 09:04:31 PM npm ERR! syscall spawn
Mar 6 09:04:31 PM npm ERR! file sh
Mar 6 09:04:31 PM npm ERR! errno ENOENT
Mar 6 09:04:31 PM npm ERR! server@1.0.0 server: nodemon node ./server.js
Mar 6 09:04:31 PM npm ERR! spawn ENOENT
Mar 6 09:04:31 PM npm ERR!
Mar 6 09:04:31 PM npm ERR! Failed at the server@1.0.0 server script.
Mar 6 09:04:31 PM npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Mar 6 09:04:31 PM
Mar 6 09:04:31 PM npm ERR! A complete log of this run can be found in:
Mar 6 09:04:31 PM npm ERR! /opt/render/.cache/_logs/2023-03-07T00_04_31_718Z-debug.log
Mar 6 09:05:11 PM ==> Starting service with ‘npm run server’
Mar 6 09:05:13 PM
Mar 6 09:05:13 PM > server@1.0.0 server /opt/render/project/src/server
Mar 6 09:05:13 PM > nodemon node ./server.js
Mar 6 09:05:13 PM
Mar 6 09:05:13 PM sh: 1: nodemon: not found
Mar 6 09:05:13 PM npm ERR! code ELIFECYCLE
Mar 6 09:05:13 PM npm ERR! syscall spawn
Mar 6 09:05:13 PM npm ERR! file sh
Mar 6 09:05:13 PM npm ERR! errno ENOENT
Mar 6 09:05:13 PM npm ERR! server@1.0.0 server: nodemon node ./server.js
Mar 6 09:05:13 PM npm ERR! spawn ENOENT
Mar 6 09:05:13 PM npm ERR!
Mar 6 09:05:13 PM npm ERR! Failed at the server@1.0.0 server script.
Mar 6 09:05:13 PM npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Mar 6 09:05:14 PM
Mar 6 09:05:14 PM npm ERR! A complete log of this run can be found in:
Mar 6 09:05:14 PM npm ERR! /opt/render/.cache/_logs/2023-03-07T00_05_13_995Z-debug.log
Thanks,
I’ve tried it but it still giving an error, now it is the following
Mar 7 02:56:35 PM run npm audit fix to fix them, or npm audit for details
Mar 7 02:56:36 PM npm ERR! missing script: build
Mar 7 02:56:36 PM
Mar 7 02:56:36 PM npm ERR! A complete log of this run can be found in:
Mar 7 02:56:36 PM npm ERR! /opt/render/.cache/_logs/2023-03-07T17_56_36_159Z-debug.log
Mar 7 02:56:36 PM ==> Build failed
Mar 7 02:56:36 PM ==> Generating container image from build. This may take a few minutes…
There isn’t a build script in your package.json, so it’s either script named differently, or your service doesn’t require building, and you can remove the && npm run build from my previous example. You’ll know your app better than us.