Trying to deploy simple css/html project to Heroku and getting errors with my packages.json file

199 Views Asked by At

I've deployed entire solutions running on SQL Server to Appharbor before with no problems, but that failed me and so is heroku. I don't have a web.config file so I don't know if that's the issue, but the errors are saying it's something to do with the npm and the scripts or something.

The project is actually a follow along course on Udemy. Here is the code in my packages.json file.

    {
"name": "mynatour",
"version": "1.0.0",
"description": "landing page for natours",
"main": "index.js",
"scripts": {
  "watch:sass": "node-sass sass/main.scss css/style.css -w",
  "devserver": "live-server",
  "start": "npm-run-all --parallel devserver watch:sass",
  "compile:sass": "node-sass sass/main.scss css/style.css",
  "prefix:css": "postcss --use autoprefixer -b 'last 10 versions' css/style.comp.css -o css/style.prefix.css",
  "compress:css": "node-sass css/style.prefix.css css/style.css --output-style compressed",
  "build:css": "npm-run-all compile:sass prefix:css compress:css"
},
"author": "Nate Osterfeld",
"license": "ISC",
"devDependencies": {
"node-sass": "^4.9.3"
},
"engines": {
  "node": "8.11.4"
 }
}

and then this is an example of the errors I got when I tried running heroku logs --tail. I actually added in the "engines: {"node": "8.11.4"}" part after getting these errors and haven't tried it again because I was pretty confident that wasn't the issue.

C:\Users\nawst\Documents\AppHarbor\Natours>heroku logs --tail
2018-10-09T08:46:16.446756+00:00 app[api]: Initial release by user 
[email protected]
2018-10-09T08:46:16.584085+00:00 app[api]: Release v2 created by user 
[email protected]
2018-10-09T08:46:16.584085+00:00 app[api]: Enable Logplex by user 
[email protected]
2018-10-09T08:46:16.446756+00:00 app[api]: Release v1 created by user 
[email protected]
2018-10-09T08:53:33.000000+00:00 app[api]: Build started by user 
[email protected]
2018-10-09T08:53:53.266782+00:00 app[api]: Deploy 0800a257 by user 
[email protected]
2018-10-09T08:53:53.266782+00:00 app[api]: Release v3 created by user         
[email protected]
2018-10-09T08:53:53.291586+00:00 app[api]: Scaled to web@1:Free by user 
[email protected]
2018-10-09T08:53:54.000000+00:00 app[api]: Build succeeded
2018-10-09T08:53:56.747007+00:00 heroku[web.1]: Starting process with 
command 
`npm start`
2018-10-09T08:54:00.316721+00:00 heroku[web.1]: State changed from starting 
to crashed
2018-10-09T08:54:00.318587+00:00 heroku[web.1]: State changed from crashed 
to 
starting
2018-10-09T08:54:00.272201+00:00 heroku[web.1]: Process exited with status 1
2018-10-09T08:54:00.113919+00:00 app[web.1]:
2018-10-09T08:54:00.113945+00:00 app[web.1]: > [email protected] start /app
2018-10-09T08:54:00.113948+00:00 app[web.1]: > npm-run-all --parallel 
devserver watch:sass
2018-10-09T08:54:00.113949+00:00 app[web.1]:
2018-10-09T08:54:00.124737+00:00 app[web.1]: sh: 1: npm-run-all: not found
2018-10-09T08:54:00.133551+00:00 app[web.1]: npm ERR! file sh
2018-10-09T08:54:00.133950+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-09T08:54:00.134310+00:00 app[web.1]: npm ERR! errno ENOENT
2018-10-09T08:54:00.134457+00:00 app[web.1]: npm ERR! syscall spawn
2018-10-09T08:54:00.136382+00:00 app[web.1]: npm ERR! [email protected] start: 
`npm-run-all --parallel devserver watch:sass`
2018-10-09T08:54:00.136568+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-10-09T08:54:00.137095+00:00 app[web.1]: npm ERR!
2018-10-09T08:54:00.137098+00:00 app[web.1]: npm ERR! Failed at the 
[email protected] start script.
2018-10-09T08:54:00.137189+00:00 app[web.1]: npm ERR! This is probably not a 
problem with npm. There is likely additional logging output above.
2018-10-09T08:54:00.159715+00:00 app[web.1]: npm ERR!     
/app/.npm/_logs/2018-10-09T08_54_00_139Z-debug.log
2018-10-09T08:54:00.159256+00:00 app[web.1]:
2018-10-09T08:54:00.159566+00:00 app[web.1]: npm ERR! A complete log of this 
run can be found in:
2018-10-09T08:54:02.987816+00:00 heroku[web.1]: Starting process with 
command 
`npm start`
2018-10-09T08:54:06.226743+00:00 app[web.1]:
2018-10-09T08:54:06.226765+00:00 app[web.1]: > [email protected] start /app
2018-10-09T08:54:06.226767+00:00 app[web.1]: > npm-run-all --parallel 
devserver watch:sass
2018-10-09T08:54:06.226769+00:00 app[web.1]:
2018-10-09T08:54:06.235113+00:00 app[web.1]: sh: 1: npm-run-all: not found
2018-10-09T08:54:06.239091+00:00 app[web.1]: npm ERR! file sh
2018-10-09T08:54:06.239294+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-09T08:54:06.239449+00:00 app[web.1]: npm ERR! errno ENOENT
2018-10-09T08:54:06.239603+00:00 app[web.1]: npm ERR! syscall spawn
2018-10-09T08:54:06.240648+00:00 app[web.1]: npm ERR! [email protected] start: 
`npm-run-all --parallel devserver watch:sass`
2018-10-09T08:54:06.240754+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-10-09T08:54:06.240926+00:00 app[web.1]: npm ERR!
2018-10-09T08:54:06.241034+00:00 app[web.1]: npm ERR! Failed at the 
[email protected] start script.
2018-10-09T08:54:06.241140+00:00 app[web.1]: npm ERR! This is probably not a 
problem with npm. There is likely additional logging output above.
2018-10-09T08:54:06.245690+00:00 app[web.1]: npm ERR! A complete log of this 
run can be found in:
2018-10-09T08:54:06.245551+00:00 app[web.1]:
2018-10-09T08:54:06.245760+00:00 app[web.1]: npm ERR!     
/app/.npm/_logs/2018-10-09T08_54_06_242Z-debug.log
2018-10-09T08:54:06.388899+00:00 heroku[web.1]: State changed from starting 
to crashed
2018-10-09T08:54:06.351924+00:00 heroku[web.1]: Process exited with status 1
2018-10-09T09:05:50.634018+00:00 heroku[router]: at=error code=H10 desc="App 
crashed" method=GET path="/" host=natesnature.herokuapp.com 
request_id=270c4eca-fc4f-4d7d-9985-7a61ff670e32 fwd="50.5.131.20" dyno= 
connect= service= status=503 bytes= protocol=https
2018-10-09T09:05:50.798408+00:00 heroku[router]: at=error code=H10 desc="App 
crashed" method=GET path="/favicon.ico" host=natesnature.herokuapp.com 
request_id=bfd631c6-c4eb-42bf-84ac-79f6d2b7e0f5 fwd="50.5.131.20" dyno= 
connect= service= status=503 bytes= protocol=https
2018-10-09T09:28:51.489429+00:00 heroku[web.1]: State changed from crashed 
to  
starting
2018-10-09T09:28:55.846067+00:00 heroku[web.1]: Starting process with 
command 
`npm start`
2018-10-09T09:28:59.617210+00:00 heroku[web.1]: State changed from starting 
to crashed
2018-10-09T09:28:59.592352+00:00 heroku[web.1]: Process exited with status 1
2018-10-09T09:28:59.467719+00:00 app[web.1]:
2018-10-09T09:28:59.467739+00:00 app[web.1]: > [email protected] start /app
2018-10-09T09:28:59.467741+00:00 app[web.1]: > npm-run-all --parallel 
devserver watch:sass
2018-10-09T09:28:59.467742+00:00 app[web.1]:
2018-10-09T09:28:59.477723+00:00 app[web.1]: sh: 1: npm-run-all: not found
2018-10-09T09:28:59.485879+00:00 app[web.1]: npm ERR! file sh
2018-10-09T09:28:59.486309+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-09T09:28:59.488403+00:00 app[web.1]: npm ERR! errno ENOENT
2018-10-09T09:28:59.488694+00:00 app[web.1]: npm ERR! syscall spawn
2018-10-09T09:28:59.491092+00:00 app[web.1]: npm ERR! [email protected] start: 
`npm-run-all --parallel devserver watch:sass`
2018-10-09T09:28:59.491289+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-10-09T09:28:59.491671+00:00 app[web.1]: npm ERR!
2018-10-09T09:28:59.491858+00:00 app[web.1]: npm ERR! Failed at the 
[email protected] start script.
2018-10-09T09:28:59.492050+00:00 app[web.1]: npm ERR! This is probably not a 
problem with npm. There is likely additional logging output above.
2018-10-09T09:28:59.509389+00:00 app[web.1]:
2018-10-09T09:28:59.509757+00:00 app[web.1]: npm ERR! A complete log of this 
run can be found in:
2018-10-09T09:28:59.510144+00:00 app[web.1]: npm ERR!     
/app/.npm/_logs/2018-10-09T09_28_59_495Z-debug.log
 !    Logs eventsource failed with: 401 Unauthorized 
1

There are 1 best solutions below

0
Jameson Saunders On

The failure starts here: sh: 1: npm-run-all: not found.

You seem to not have npm-run-all installed, or it's not available on your PATH.

From the setup instructions at npm-run-all, run this from your project directory: npm install npm-run-all --save-dev

The reason I know to do this is because I use npm a lot and npm-run-all isn't a built-in command.