I'm having trouble getting my reveal.js-based app to work on Heroku. I decided to step back and just try to get the vanilla reveal.js code successfully deployed to Heroku. I'm having trouble with that basic step. Heroku gives an:
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
I followed the Getting Started on Heroku with Node.js guide, but grabbed the reveal.js code from GitHub using the Full setup Readme steps. Here are the steps I followed along with the results from the Terminal:
$ git clone https://github.com/hakimel/reveal.js.git
Cloning into 'reveal.js'...
remote: Counting objects: 10252, done.
remote: Total 10252 (delta 0), reused 0 (delta 0), pack-reused 10252
Receiving objects: 100% (10252/10252), 7.58 MiB | 6.55 MiB/s, done.
Resolving deltas: 100% (5644/5644), done.
$ ls
moac-node-reveal moac-solo-with-php reveal.js
$ cd reveal.js/
$ ls
CONTRIBUTING.md LICENSE bower.json demo.html js package.json test
Gruntfile.js README.md css index.html lib plugin
$ npm install
npm WARN deprecated coffee-script#1.10.0: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated http2#3.3.7: Use the built-in module in node 9.0.0 or newer, instead
> node-sass#4.7.2 install /Users/simon/code/reveal.js/node_modules/node-sass
> node scripts/install.js
Cached binary found at /Users/simon/.npm/node-sass/4.7.2/darwin-x64-59_binding.node
> phantomjs-prebuilt#2.1.16 install /Users/simon/code/reveal.js/node_modules/phantomjs-prebuilt
> node install.js
PhantomJS not found on PATH
Download already available at /var/folders/0n/rj76dqgx3yvd2tph37qlyvsm0000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip
Verified checksum of previously downloaded file
Extracting zip contents
Removing /Users/simon/code/reveal.js/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /var/folders/0n/rj76dqgx3yvd2tph37qlyvsm0000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip-extract-1514746311473/phantomjs-2.1.1-macosx -> /Users/simon/code/reveal.js/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /Users/simon/code/reveal.js/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
> node-sass#4.7.2 postinstall /Users/simon/code/reveal.js/node_modules/node-sass
> node scripts/build.js
Binary found at /Users/simon/code/reveal.js/node_modules/node-sass/vendor/darwin-x64-59/binding.node
Testing binary
Binary is fine
npm notice created a lockfile as package-lock.json. You should commit this file.
added 473 packages in 13.798s
╭─────────────────────────────────────╮
│ │
│ Update available 5.5.1 → 5.6.0 │
│ Run npm i -g npm to update │
│ │
╰─────────────────────────────────────╯
$ npm start
> reveal.js#3.6.0 start /Users/simon/code/reveal.js
> grunt serve
(node:7173) ExperimentalWarning: The http2 module is an experimental API.
Running "connect:server" (connect) task
Started connect web server on http://localhost:8000
Running "watch" task
Waiting...
^C
╭─────────────────────────────────────╮
│ │
│ Update available 5.5.1 → 5.6.0 │
│ Run npm i -g npm to update │
│ │
╰─────────────────────────────────────╯
$ heroku login
Enter your Heroku credentials:
Email: redacted#email.address
Password: **************
Two-factor code: ******
Logged in as redacted#email.address
$ node -v
v9.3.0
$ npm -v
5.5.1
$ git --version
git version 2.14.3 (Apple Git-98)
$ heroku create
Creating app... done, ⬢ calm-crag-42588
https://calm-crag-42588.herokuapp.com/ | https://git.heroku.com/calm-crag-42588.git
$ git push heroku master
Counting objects: 10020, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3988/3988), done.
Writing objects: 100% (10020/10020), 7.43 MiB | 677.00 KiB/s, done.
Total 10020 (delta 5525), reused 10020 (delta 5525)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): >=4.0.0
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version >=4.0.0...
remote: Downloading and installing node 9.3.0...
remote: Using default npm version: 5.5.1
remote:
remote: -----> Restoring cache
remote: Skipping cache restore (not-found)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json)
remote: up to date in 0.09s
remote:
remote: -----> Caching build
remote: Clearing previous node cache
remote: Saving 2 cacheDirectories (default):
remote: - node_modules (nothing to cache)
remote: - bower_components (nothing to cache)
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote: Done: 18.7M
remote: -----> Launching...
remote: Released v3
remote: https://calm-crag-42588.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/calm-crag-42588.git
* [new branch] master -> master
$ heroku ps:scale web=1
Scaling dynos... done, now running web at 1:Free
$ heroku open
$ heroku logs
2017-12-31T18:55:41.167608+00:00 app[api]: Release v2 created by user redacted#email.address
2017-12-31T18:55:40.984802+00:00 app[api]: Release v1 created by user redacted#email.address
2017-12-31T18:55:40.984802+00:00 app[api]: Initial release by user redacted#email.address
2017-12-31T18:55:41.167608+00:00 app[api]: Enable Logplex by user redacted#email.address
2017-12-31T18:56:13.000000+00:00 app[api]: Build started by user redacted#email.address
2017-12-31T18:56:20.523781+00:00 app[api]: Scaled to web#1:Free by user redacted#email.address
2017-12-31T18:56:20.502923+00:00 app[api]: Release v3 created by user redacted#email.address
2017-12-31T18:56:20.502923+00:00 app[api]: Deploy a0c01360 by user redacted#email.address
2017-12-31T18:56:13.000000+00:00 app[api]: Build succeeded
2017-12-31T18:56:22.217173+00:00 heroku[web.1]: Starting process with command `npm start`
2017-12-31T18:56:24.295551+00:00 app[web.1]: > reveal.js#3.6.0 start /app
2017-12-31T18:56:24.295401+00:00 app[web.1]:
2017-12-31T18:56:24.295552+00:00 app[web.1]: > grunt serve
2017-12-31T18:56:24.295553+00:00 app[web.1]:
2017-12-31T18:56:24.306026+00:00 app[web.1]: sh: 1: grunt: not found
2017-12-31T18:56:24.310223+00:00 app[web.1]: npm ERR! file sh
2017-12-31T18:56:24.310226+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-12-31T18:56:24.310227+00:00 app[web.1]: npm ERR! errno ENOENT
2017-12-31T18:56:24.310228+00:00 app[web.1]: npm ERR! syscall spawn
2017-12-31T18:56:24.311279+00:00 app[web.1]: npm ERR! reveal.js#3.6.0 start: `grunt serve`
2017-12-31T18:56:24.311803+00:00 app[web.1]: npm ERR! Failed at the reveal.js#3.6.0 start script.
2017-12-31T18:56:24.311414+00:00 app[web.1]: npm ERR! spawn ENOENT
2017-12-31T18:56:24.311669+00:00 app[web.1]: npm ERR!
2017-12-31T18:56:24.311943+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-12-31T18:56:24.317995+00:00 app[web.1]: npm WARN Local package.json exists, but node_modules missing, did you mean to install?
2017-12-31T18:56:24.318729+00:00 app[web.1]:
2017-12-31T18:56:24.318964+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-12-31T18:56:24.319122+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2017-12-31T18_56_24_313Z-debug.log
2017-12-31T18:56:27.086467+00:00 heroku[web.1]: Starting process with command `npm start`
2017-12-31T18:56:24.393036+00:00 heroku[web.1]: Process exited with status 1
2017-12-31T18:56:24.405623+00:00 heroku[web.1]: State changed from starting to crashed
2017-12-31T18:56:24.407532+00:00 heroku[web.1]: State changed from crashed to starting
2017-12-31T18:56:30.585270+00:00 heroku[web.1]: State changed from starting to crashed
2017-12-31T18:56:30.556563+00:00 heroku[web.1]: Process exited with status 1
2017-12-31T18:56:30.393715+00:00 app[web.1]:
2017-12-31T18:56:30.393731+00:00 app[web.1]: > reveal.js#3.6.0 start /app
2017-12-31T18:56:30.393732+00:00 app[web.1]: > grunt serve
2017-12-31T18:56:30.393732+00:00 app[web.1]:
2017-12-31T18:56:30.400445+00:00 app[web.1]: sh: 1: grunt: not found
2017-12-31T18:56:30.404923+00:00 app[web.1]: npm ERR! file sh
2017-12-31T18:56:30.405234+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-12-31T18:56:30.405479+00:00 app[web.1]: npm ERR! errno ENOENT
2017-12-31T18:56:30.405725+00:00 app[web.1]: npm ERR! syscall spawn
2017-12-31T18:56:30.409574+00:00 app[web.1]: npm ERR! reveal.js#3.6.0 start: `grunt serve`
2017-12-31T18:56:30.409737+00:00 app[web.1]: npm ERR! spawn ENOENT
2017-12-31T18:56:30.410022+00:00 app[web.1]: npm ERR!
2017-12-31T18:56:30.410205+00:00 app[web.1]: npm ERR! Failed at the reveal.js#3.6.0 start script.
2017-12-31T18:56:30.410375+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-12-31T18:56:30.428235+00:00 app[web.1]: npm WARN Local package.json exists, but node_modules missing, did you mean to install?
2017-12-31T18:56:30.429020+00:00 app[web.1]:
2017-12-31T18:56:30.429211+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-12-31T18:56:30.429337+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2017-12-31T18_56_30_412Z-debug.log
2017-12-31T18:56:36.818819+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=calm-crag-42588.herokuapp.com request_id=8b23ad0b-29bd-4a6a-bbf8-cd991fdc334a fwd="47.32.63.6" dyno= connect= service= status=503 bytes= protocol=https
2017-12-31T18:56:37.254436+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=calm-crag-42588.herokuapp.com request_id=8267e9aa-69ca-4998-b967-89e1db724b30 fwd="47.32.63.6" dyno= connect= service= status=503 bytes= protocol=https
Two things fixed this:
1. package.json: moved devDependencies to dependencies
"devDependencies": {
"express": "^4.16.2",
"grunt": "^1.0.1",
"grunt-autoprefixer": "^3.0.4",
"grunt-cli": "^1.2.0",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-cssmin": "^2.2.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-qunit": "^1.2.0",
"grunt-contrib-uglify": "^2.3.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-retire": "^1.0.7",
"grunt-sass": "^2.0.0",
"grunt-zip": "^0.17.1",
"mustache": "^2.3.0",
"socket.io": "^1.7.4"},
...became:
"devDependencies": {},
And:
"dependencies": {
"reveal-ga": "^0.1.0"}
...became:
"dependencies": {
"reveal-ga": "^0.1.0",
"express": "^4.16.2",
"grunt": "^1.0.1",
"grunt-autoprefixer": "^3.0.4",
"grunt-cli": "^1.2.0",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-cssmin": "^2.2.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-qunit": "^1.2.0",
"grunt-contrib-uglify": "^2.3.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-retire": "^1.0.7",
"grunt-sass": "^2.0.0",
"grunt-zip": "^0.17.1",
"mustache": "^2.3.0",
"socket.io": "^1.7.4"}
Gruntfile.js: use $PORT environment variable
var port = grunt.option('port') || 8000;
...became:
var port = grunt.option('port') || process.env.PORT || 8000;
Related
I am following a Udemy course and the github repo is located here: https://github.com/StephenGrider/FullstackReactCode. The error occurs when I try to deploy the application to git and push to Heroku. When I follow these steps Heroku is supposed to automatically install all of the project's server-side dependencies which is caused by a 'heroku-postbuild' script in the server-side-folder JSON package. After Heroku runs all of the server's dependencies, it is supposed to automatically run a 'heroku-postbuild' script that instructs Heroku to (1) install all of the client-side dependencies in the client-side-folder JSON package and then (2) run the command 'npm run build' from within the client-folder directory. After these steps Heroku is supposed to try to start the application but I get the error below. FYI--I followed the directions within the error message but they didn't work. I've also included links to suggested solutions but they don't match my project's package.json structures so the solutions aren't helpful. I've also tried to install eslint as a dependency in both JSON packages but that hasn't worked either.
Possible solutions:
Why is 'type: module' in package.json file?
https://github.com/eslint/eslint/issues/14137
ESlint - Error: Must use import to load ES Module
This is my error:
$ git push heroku master
Enumerating objects: 74, done.
Counting objects: 100% (74/74), done.
Delta compression using up to 12 threads
Compressing objects: 100% (59/59), done.
Writing objects: 100% (63/63), 170.95 KiB | 5.18 MiB/s, done.
Total 63 (delta 17), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/nodejs
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 12.16.3
remote: engines.npm (package.json): 6.14.4
remote:
remote: Resolving node version 12.16.3...
remote: Downloading and installing node 12.16.3...
remote: npm 6.14.4 already installed with node
remote:
remote: -----> Restoring cache
remote: - node_modules
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote:
remote: > nodemon#2.0.15 postinstall /tmp/build_fc9f4df1/node_modules/nodemon
remote: > node bin/postinstall || exit 0
remote:
remote: Love nodemon? You can now support the project via the open collective:
remote: > https://opencollective.com/nodemon/donate
remote:
remote: added 295 packages in 4.112s
remote:
remote: -----> Build
remote: Running heroku-postbuild
remote:
remote: > server#1.0.0 heroku-postbuild /tmp/build_fc9f4df1
remote: > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
remote:
remote:
remote: > core-js#3.21.1 postinstall /tmp/build_fc9f4df1/client/node_modules/core-js
remote: > node -e "try{require('./postinstall')}catch(e){}"
remote:
remote:
remote: > core-js-pure#3.21.1 postinstall /tmp/build_fc9f4df1/client/node_modules/core-js-pure
remote: > node -e "try{require('./postinstall')}catch(e){}"
remote:
remote: added 1434 packages from 699 contributors and audited 1436 packages in 19.485s
remote:
remote: 169 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: found 4 moderate severity vulnerabilities
remote: run `npm audit fix` to fix them, or `npm audit` for details
remote:
remote: > client#0.1.0 build /tmp/build_fc9f4df1/client
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: Must use import to load ES Module: /tmp/build_fc9f4df1/client/node_modules/#eslint/eslintrc/universal.js
remote: require() of ES modules is not supported.
remote: require() of /tmp/build_fc9f4df1/client/node_modules/#eslint/eslintrc/universal.js from
/tmp/build_fc9f4df1/client/node_modules/eslint/lib/linter/linter.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
remote: Instead rename universal.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /tmp/build_fc9f4df1/client/node_modules/#eslint/eslintrc/package.json.
remote:
remote:
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! client#0.1.0 build: `react-scripts build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the client#0.1.0 build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.fuU8Z/_logs/2022-03-18T18_29_34_363Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! server#1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the server#1.0.0 heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.fuU8Z/_logs/2022-03-18T18_29_34_382Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to stormy-journey-31783.
remote:
To https://git.heroku.com/stormy-journey-31783.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/stormy-journey-31783.git'
This is my Heroku Build Log:
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/nodejs
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 12.16.3
engines.npm (package.json): 6.14.4
Resolving node version 12.16.3...
Downloading and installing node 12.16.3...
npm 6.14.4 already installed with node
-----> Restoring cache
- node_modules
-----> Installing dependencies
Installing node modules
> nodemon#2.0.15 postinstall /tmp/build_40a7066f/node_modules/nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
> https://opencollective.com/nodemon/donate
added 228 packages in 3.89s
-----> Build
Running heroku-postbuild
> server#1.0.0 heroku-postbuild /tmp/build_40a7066f
> NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
> core-js#3.21.1 postinstall /tmp/build_40a7066f/client/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure#3.21.1 postinstall /tmp/build_40a7066f/client/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
added 1435 packages from 699 contributors and audited 1437 packages in 20.981s
169 packages are looking for funding
run `npm fund` for details
found 4 moderate severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
> client#0.1.0 build /tmp/build_40a7066f/client
> react-scripts build
Creating an optimized production build...
Failed to compile.
Must use import to load ES Module: /tmp/build_40a7066f/client/node_modules/#eslint/eslintrc/universal.js
require() of ES modules is not supported.
require() of /tmp/build_40a7066f/client/node_modules/#eslint/eslintrc/universal.js from /tmp/build_40a7066f/client/node_modules/eslint/lib/linter/linter.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename universal.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /tmp/build_40a7066f/client/node_modules/#eslint/eslintrc/package.json.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client#0.1.0 build 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! /tmp/npmcache.PAGiQ/_logs/2022-03-15T22_15_39_679Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server#1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server#1.0.0 heroku-postbuild 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! /tmp/npmcache.PAGiQ/_logs/2022-03-15T22_15_39_694Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
This is my package.json file in the server-side folder directory:
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"engines": {
"node": "12.16.3",
"npm": "6.14.4"
},
"scripts": {
"start": "node index",
"server": "nodemon index",
"client": "npm run start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.2",
"concurrently": "^7.0.0",
"cookie-session": "^2.0.0",
"eslint": "^8.11.0",
"express": "^4.17.1",
"mongoose": "^6.2.4",
"nodemon": "^2.0.15",
"passport": "^0.5.2",
"passport-google-oauth20": "^2.0.0",
"stripe": "^8.209.0"
}
}
This is my package.json file in the client-side folder directory:
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^5.16.2",
"#testing-library/react": "^12.1.4",
"#testing-library/user-event": "^13.5.0",
"axios": "^0.26.1",
"eslint": "^8.11.0",
"http-proxy-middleware": "^2.0.3",
"materialize-css": "^1.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.6",
"react-router-dom": "^5.3.0",
"react-scripts": "5.0.0",
"react-stripe-checkout": "^2.6.3",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Well, I have pushed my TypeScript project to github, and it has these scripts:
"scripts": {
"test": "jest",
"test:cov": "jest --coverage -i",
"test:unit": "jest unit --coverage -i",
"test:int": "jest int --coverage -i",
"build": "rimraf ./dist && tsc",
"start": "node ./dist/index.js",
"dev": "ts-node-dev --respawn --transpile-only --inspect -- ./src/index.ts"
}
After that, I created a github action workflow, making it run my tests and if they all pass, it deploys to heroku, but when the deployment is made, the heroku app crashes instantly.
This is the workflow:
main.yml:
name: Main workflow
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.18.1]
steps:
- uses: actions/checkout#v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v2.4.1
with:
node-version: ${{ matrix.node-version }}
- name: Install deps
run: yarn --frozen-lockfile
- name: Test
env:
MONGODB_URL_TEST: ${{secrets.MONGODB_URL_TEST}}
AUTH_TOKEN: ${{secrets.AUTH_TOKEN}}
run: yarn test
- name: Build the project
run: yarn build
- name: Deploy the project
if: ${{github.ref == 'refs/heads/main'}}
uses: akhileshns/heroku-deploy#v3.12.12
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "testjvcapi"
heroku_email: "joaovitorcasarin#hotmail.com"
env:
HD_MONGODB_URL: ${{secrets.MONGODB_URL}}
HD_AUTH_TOKEN: ${{secrets.AUTH_TOKEN}}
This is the last action that I triggered: https://github.com/joaocasarin/test-selfapi/actions/runs/1365239970
This is the repo: https://github.com/joaocasarin/test-selfapi/
This is the log after the deployment to heroku:
2021-10-20T20:33:33.000000+00:00 app[api]: Build started by user *****#hotmail.com
2021-10-20T20:34:16.052764+00:00 app[api]: Release v6 created by user *****#hotmail.com
2021-10-20T20:34:16.052764+00:00 app[api]: Deploy 1192ce7c by user *****#hotmail.com
2021-10-20T20:34:16.359307+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-20T20:34:18.914264+00:00 heroku[web.1]: Starting process with command `npm start`
2021-10-20T20:34:20.660465+00:00 app[web.1]: [heroku-exec] Starting
2021-10-20T20:34:20.956196+00:00 app[web.1]:
2021-10-20T20:34:20.956213+00:00 app[web.1]: > self-api#1.0.0 start /app
2021-10-20T20:34:20.956214+00:00 app[web.1]: > node ./dist/index.js
2021-10-20T20:34:20.956214+00:00 app[web.1]:
2021-10-20T20:34:21.713756+00:00 app[web.1]: Listening on port 8260
2021-10-20T20:34:21.775734+00:00 heroku[web.1]: State changed from starting to up
2021-10-20T20:34:21.911902+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-10-20T20:34:21.912248+00:00 app[web.1]: npm ERR! errno 1
2021-10-20T20:34:21.926340+00:00 app[web.1]: npm ERR! self-api#1.0.0 start: `node ./dist/index.js`
2021-10-20T20:34:21.926408+00:00 app[web.1]: npm ERR! Exit status 1
2021-10-20T20:34:21.926490+00:00 app[web.1]: npm ERR!
2021-10-20T20:34:21.926548+00:00 app[web.1]: npm ERR! Failed at the self-api#1.0.0 start script.
2021-10-20T20:34:21.926604+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-10-20T20:34:21.933864+00:00 app[web.1]:
2021-10-20T20:34:21.933977+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-10-20T20:34:21.934035+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-10-20T20_34_21_928Z-debug.log
2021-10-20T20:34:22.121378+00:00 heroku[web.1]: Process exited with status 1
2021-10-20T20:34:22.265731+00:00 heroku[web.1]: State changed from up to crashed
2021-10-20T20:34:22.288685+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-20T20:34:24.000000+00:00 app[api]: Build succeeded
2021-10-20T20:34:24.543897+00:00 heroku[web.1]: Starting process with command `npm start`
2021-10-20T20:34:25.605048+00:00 app[web.1]: [heroku-exec] Starting
2021-10-20T20:34:25.900511+00:00 app[web.1]:
2021-10-20T20:34:25.900518+00:00 app[web.1]: > self-api#1.0.0 start /app
2021-10-20T20:34:25.900518+00:00 app[web.1]: > node ./dist/index.js
2021-10-20T20:34:25.900519+00:00 app[web.1]:
2021-10-20T20:34:26.661060+00:00 app[web.1]: Listening on port 33178
2021-10-20T20:34:26.671025+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-10-20T20:34:26.674395+00:00 app[web.1]: npm ERR! errno 1
2021-10-20T20:34:26.676324+00:00 app[web.1]: npm ERR! self-api#1.0.0 start: `node ./dist/index.js`
2021-10-20T20:34:26.676389+00:00 app[web.1]: npm ERR! Exit status 1
2021-10-20T20:34:26.676462+00:00 app[web.1]: npm ERR!
2021-10-20T20:34:26.676511+00:00 app[web.1]: npm ERR! Failed at the self-api#1.0.0 start script.
2021-10-20T20:34:26.676557+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-10-20T20:34:26.682667+00:00 app[web.1]:
2021-10-20T20:34:26.682776+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-10-20T20:34:26.682829+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-10-20T20_34_26_677Z-debug.log
2021-10-20T20:34:26.877812+00:00 heroku[web.1]: Process exited with status 1
2021-10-20T20:34:27.141848+00:00 heroku[web.1]: State changed from starting to crashed
Can someone please give me a light? This is the first time I try github actions.
Thanks
Edit.: This is the Deploy the project step information:
Run akhileshns/heroku-deploy#v3.12.12
Created and wrote to ~/.netrc
Successfully logged into heroku
› Warning: Our terms of service have changed:
› https://dashboard.heroku.com/terms-of-service
Added git remote heroku
Setting MONGODB_URL, AUTH_TOKEN and restarting testjvcapi... done, v5
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/nodejs
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: USE_YARN_CACHE=true
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote: engines.yarn (package.json): unspecified (use default)
remote:
remote: Resolving node version 14.x...
remote: Downloading and installing node 14.18.1...
remote: Using default npm version: 6.14.15
remote: Resolving yarn version 1.22.x...
remote: Downloading and installing yarn (1.22.17)
remote: Installed yarn 1.22.17
remote:
remote: -----> Restoring cache
remote: - yarn cache
remote:
remote: -----> Installing dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v1.22.17
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: [3/4] Linking dependencies...
remote: [4/4] Building fresh packages...
remote: Done in 7.59s.
remote:
remote: -----> Build
remote: Running build (yarn)
remote: yarn run v1.22.17
remote: $ rimraf ./dist && tsc
remote: Done in 11.61s.
remote:
remote: -----> Pruning devDependencies
remote: yarn install v1.22.17
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: [3/4] Linking dependencies...
remote: [4/4] Building fresh packages...
remote: warning Ignored scripts due to flag.
remote: Done in 3.65s.
remote:
remote: -----> Caching build
remote: - yarn cache
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote: Done: 41.9M
remote: -----> Launching...
remote: Released v6
remote: https://testjvcapi.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/testjvcapi.git
f9075d9..1192ce7 HEAD -> main
As Bertrand said, there was something wrong with the mongodb connection, so I just found that the variable MONGODB_URL was not set, only the test one was, so it was making the app crash because it was undefined for mongoose, making it exit.
I'm really stuck and would really appreciate some help. This question was asked previously here Error while pushing to Heroku: Cannot find module 'node-linux-x64/package.json' however, despite trying all the suggestions I was still unable to resolve this problem.
Just like the individual before who posted the problem initially, I am trying to push a full stack Javascript app to Heroku.
I've re-installed all my dependencies and even downgraded my node and npm.
This issue is especially confusing as I am a Windows user, so to be receiving an error about a module regarding linux feels quite strange.
Please help.
C:\Users\Greg\Desktop\GregBots\reactbot> git push heroku master
Enumerating objects: 41, done.
Counting objects: 100% (41/41), done.
Delta compression using up to 8 threads
Compressing objects: 100% (28/28), done.
Writing objects: 100% (28/28), 19.45 KiB | 1.95 MiB/s, done.
Total 28 (delta 15), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 13.6.0
remote: engines.npm (package.json): 6.13.4
remote:
remote: Resolving node version 13.6.0...
remote: Downloading and installing node 13.6.0...
remote: npm 6.13.4 already installed with node
remote:
remote: -----> Restoring cache
remote: Cached directories were not restored due to a change in version of node, npm, yarn or stack
remote: Module installation may take longer for this build
remote:
remote: -----> Installing dependencies
remote: Installing node modules (package.json + package-lock)
remote:
remote: > node#13.8.0 preinstall /tmp/build_5798122e415d759253929a4b5b0a6c16/node_modules/node
remote: > node installArchSpecificPackage
remote:
remote: npm ERR! code ETARGET
remote: npm ERR! notarget No matching version found for node-linux-x64#13.8.0.
remote: npm ERR! notarget In most cases you or one of your dependencies are requesting
remote: npm ERR! notarget a package version that doesn't exist.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.3VsTs/_logs/2020-02-26T01_02_25_357Z-debug.log
remote: internal/modules/cjs/loader.js:976
remote: throw err;
remote: ^
remote:
remote: Error: Cannot find module 'node-linux-x64/package.json'
remote: Require stack:
remote: - /tmp/build_5798122e415d759253929a4b5b0a6c16/node_modules/node/installArchSpecificPackage.js
remote: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:973:15)
remote: at Function.resolve (internal/modules/cjs/helpers.js:78:19)
remote: at ChildProcess.<anonymous> (/tmp/build_5798122e415d759253929a4b5b0a6c16/node_modules/node-bin-setup/index.js:18:27)
remote: at ChildProcess.emit (events.js:321:20)
remote: at maybeClose (internal/child_process.js:1028:16)
remote: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
remote: code: 'MODULE_NOT_FOUND',
remote: requireStack: [
remote: '/tmp/build_5798122e415d759253929a4b5b0a6c16/node_modules/node/installArchSpecificPackage.js'
remote: ]
remote: }
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! node#13.8.0 preinstall: `node installArchSpecificPackage`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the node#13.8.0 preinstall script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.3VsTs/_logs/2020-02-26T01_02_26_775Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - A module may be missing from 'dependencies' in package.json
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to infinite-sea-94371.
remote:
To https://git.heroku.com/infinite-sea-94371.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/infinite-sea-94371.git'
PS C:\Users\Greg\Desktop\GregBots\reactbot>
Thanks a bunch for your suggestions Mazen. I've went through your advice, but can't deploy to Heroku still. I've now attached my package.json which I am pushing as well to Heroku as Heroku installs the dependencies that are needed as per the package.
{
"name": "reactbot",
"version": "1.0.0",
"description": "React bot",
"main": "index.js",
"engines": {
"node": "13.6.0",
"npm": "6.13.4"
},
"scripts": {
"start": "node index.js",
"backend": "nodemon index.js",
"frontend": "npm run start --prefix client",
"dev": "concurrently \"npm run backend\" \"npm run frontend\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
},
"author": "",
"license": "ISC",
"dependencies": {
"actions-on-google": "^2.12.0",
"body-parser": "^1.19.0",
"dialogflow": "^1.2.0",
"dialogflow-fulfillment": "^0.6.1",
"express": "^4.17.1",
"mongoose": "^5.9.2"
},
"devDependencies": {
"concurrently": "^5.1.0",
"nodemon": "^2.0.2"
}
}
This error might be caused by multiple things:
According to your error, the npm package node-linux-x64 is set to the wrong version that doesn't exist. Remove node-linux-x64 as Heroku installs the most updated version of Node.js for their system or set it to an existing version.
Did you push your package.json file with your code?
You have pushed your node_module to Heroku which has certain versions of some packages that can only work on your distribution/OS.
You might have installed an npm package globally and forgot to include it to your packages.json file.
I am new to Heroku and am facing problems pushing my code to Heroku. I have a React/Node JS project. My folder structure is as follows:
I had my package.json file initially under backend folder but due to buildpack error I moved it to the root folder.
When I try pushing code to Heroku I get the following error:
\ProductInventoryApp> git push heroku HEAD:master
Enumerating objects: 110, done.
Counting objects: 100% (110/110), done.
Delta compression using up to 8 threads
Compressing objects: 100% (107/107), done.
Writing objects: 100% (110/110), 425.50 KiB | 2.73 MiB/s, done.
Total 110 (delta 38), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.x...
remote: Downloading and installing node 12.14.1...
remote: Using default npm version: 6.13.4
remote:
remote: -----> Installing dependencies
remote: Installing node modules (package.json + package-lock)
remote: added 161 packages from 100 contributors and audited 304 packages in 7.815s
remote:
remote: 2 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: found 0 vulnerabilities
remote:
remote:
remote: -----> Build
remote: Running heroku-postbuild
remote:
remote: > ProductInventoryApp#1.0.0 heroku-postbuild /tmp/build_e7c760dc5d523bf5e1c2d0dc2b5b85cf
remote: > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
remote:
remote: up to date in 0.524s
remote: found 0 vulnerabilities
remote:
remote: npm ERR! code ENOENT
remote: npm ERR! syscall open
remote: npm ERR! path /tmp/build_e7c760dc5d523bf5e1c2d0dc2b5b85cf/client/package.json
remote: npm ERR! errno -2
remote: npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_e7c760dc5d523bf5e1c2d0dc2b5b85cf/client/package.json'
remote: npm ERR! enoent This is related to npm not being able to find a file.
remote: npm ERR! enoent
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.HV3Sb/_logs/2020-01-12T03_23_13_871Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 254
remote: npm ERR! ProductInventoryApp#1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client`
remote: npm ERR! Exit status 254
remote: npm ERR!
remote: npm ERR! Failed at the ProductInventoryApp#1.0.0 heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.HV3Sb/_logs/2020-01-12T03_23_13_887Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - Node version not specified in package.json
remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to product-inventory-app.
remote:
To https://git.heroku.com/product-inventory-app.git
**! [remote rejected] HEAD -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/product-inventory-app.git'**
I am not sure what’s causing this. My package.json file is as follows:
{
"name": "ProductInventoryApp",
"version": "1.0.0",
"description": "",
"main": "backend/app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js",
"client-install": "npm install --prefix client",
"server": "nodemon app.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-validator": "^6.3.0",
"mongodb": "^3.4.0",
"mongoose": "^5.8.0",
"uuid": "^3.3.3"
},
"devDependencies": {
"concurrently": "^4.0.1"
}
}
This is being caused by an issue with the heroku-postbuild script that you've defined. Remove it from the package.json file and redeploy to Heroku to resolve the issue.
try this.. it will help you out
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix frontend && npm run build --prefix frontend"
basically, --prefix represents the path where react's package.json will exist... so, your react's package.json might be existed in frontend folder...
I've had the same problem until I've realised that my client/package.json was part of my .gitignore.
If you are using Visual Studio, it does automatically add your package to it when creating gitignore.
I was facing the same error of Heroku: “no such file or directory” but for a different problem.
In my case, I'm using docker and a docker-compose.yml with volumes to share volumes.
Heroku need instead of this file a heroku.yml which takes fewer options.
So it is needed to bring some changes to the Dockerfile (or make a copy specially for Heroku)
My docker-compose.yml file :
services:
web:
volumes:
- .:/usr/src/app
For my heroku.yml configuration, I set :
build:
docker:
web: Dockerfile.web
with a Dockerfile.web same as the original Dockerfile with the following difference :
...
ADD . /usr/src/app
...
I received this error message when deploying a meteor app to HEROKU while the HEROKU build itself was successful:
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
I believe it has to do with the version of NODE in the project being incompatible. Currently the project shows the below (I manually changed this in the project file to match a version of NODE the HEROKU command line prompted.
meteor/local/build/.node_version.txt : v8.3.0
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 8.x...
remote: Downloading and installing node 8.9.4...
remote: Using default npm version: 5.6.0
remote:
remote: -----> Restoring cache
remote: Skipping cache restore (not-found)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json + package-lock)
remote:
remote: > bcrypt#1.0.3 install /tmp/build_716b8c55d4775b8c4db0d8c2018f489f/node_modules/bcrypt
remote: > node-pre-gyp install --fallback-to-build
remote:
remote: [bcrypt] Success: "/tmp/build_716b8c55d4775b8c4db0d8c2018f489f/node_modules/bcrypt/lib/binding/bcrypt_lib.node" is installed via remote
remote: added 195 packages in 5.765s
remote:
remote: -----> Caching build
remote: Clearing previous node cache
remote: Saving 2 cacheDirectories (default):
remote: - node_modules
remote: - bower_components (nothing to cache)
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote: Done: 44.3M
remote: -----> Launching...
remote: Released v3
remote: https://missionary-expediters-app.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/missionary-expediters-app.git
* [new branch] master -> master
➜ Missionary-Expediters-Web-Application git:(master) heroku logs
2018-01-16T03:58:30.407001+00:00 app[api]: Initial release by user angelica#seaworthy.tech
2018-01-16T03:58:30.407001+00:00 app[api]: Release v1 created by user angelica#seaworthy.tech
2018-01-16T03:58:30.641875+00:00 app[api]: Release v2 created by user angelica#seaworthy.tech
2018-01-16T03:58:30.641875+00:00 app[api]: Enable Logplex by user angelica#seaworthy.tech
2018-01-16T03:59:43.000000+00:00 app[api]: Build started by user angelica#seaworthy.tech
2018-01-16T03:59:59.490555+00:00 app[api]: Deploy f900129c by user angelica#seaworthy.tech
2018-01-16T03:59:59.510788+00:00 app[api]: Scaled to web#1:Free by user angelica#seaworthy.tech
2018-01-16T03:59:43.000000+00:00 app[api]: Build succeeded
2018-01-16T04:00:03.035774+00:00 heroku[web.1]: Starting process with command `npm start`
2018-01-16T03:59:59.490555+00:00 app[api]: Release v3 created by user angelica#seaworthy.tech
2018-01-16T04:00:05.155112+00:00 app[web.1]: > Missionary-Expediters-Web-Application# start /app
2018-01-16T04:00:05.155090+00:00 app[web.1]:
2018-01-16T04:00:05.168004+00:00 app[web.1]: npm ERR! file sh
2018-01-16T04:00:05.155113+00:00 app[web.1]: > meteor run
2018-01-16T04:00:05.155114+00:00 app[web.1]:
2018-01-16T04:00:05.168910+00:00 app[web.1]: npm ERR! errno ENOENT
2018-01-16T04:00:05.162754+00:00 app[web.1]: sh: 1: meteor: not found
2018-01-16T04:00:05.171081+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-01-16T04:00:05.171090+00:00 app[web.1]: npm ERR!
2018-01-16T04:00:05.168907+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-01-16T04:00:05.168911+00:00 app[web.1]: npm ERR! syscall spawn
2018-01-16T04:00:05.170446+00:00 app[web.1]: npm ERR! Missionary-Expediters-Web-Application# start: `meteor run`
2018-01-16T04:00:05.171096+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-01-16T04:00:05.171091+00:00 app[web.1]: npm ERR! Failed at the Missionary-Expediters-Web-Application# start script.
2018-01-16T04:00:05.176036+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-01-16T04:00:05.175802+00:00 app[web.1]:
2018-01-16T04:00:05.176169+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-01-16T04_00_05_172Z-debug.log
2018-01-16T04:00:05.242382+00:00 heroku[web.1]: State changed from starting to crashed
2018-01-16T04:00:05.244044+00:00 heroku[web.1]: State changed from crashed to starting
2018-01-16T04:00:05.230580+00:00 heroku[web.1]: Process exited with status 1
2018-01-16T04:00:08.424396+00:00 heroku[web.1]: Starting process with command `npm start`
2018-01-16T04:00:10.625159+00:00 heroku[web.1]: State changed from starting to crashed
2018-01-16T04:00:10.612429+00:00 heroku[web.1]: Process exited with status 1
2018-01-16T04:00:10.540497+00:00 app[web.1]:
2018-01-16T04:00:10.540515+00:00 app[web.1]: > Missionary-Expediters-Web-Application# start /app
2018-01-16T04:00:10.540516+00:00 app[web.1]: > meteor run
2018-01-16T04:00:10.540517+00:00 app[web.1]:
2018-01-16T04:00:10.546730+00:00 app[web.1]: sh: 1: meteor: not found
2018-01-16T04:00:10.552451+00:00 app[web.1]: npm ERR! file sh
2018-01-16T04:00:10.552644+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-01-16T04:00:10.552794+00:00 app[web.1]: npm ERR! errno ENOENT
2018-01-16T04:00:10.552930+00:00 app[web.1]: npm ERR! syscall spawn
2018-01-16T04:00:10.554224+00:00 app[web.1]: npm ERR! Missionary-Expediters-Web-Application# start: `meteor run`
2018-01-16T04:00:10.554544+00:00 app[web.1]: npm ERR!
2018-01-16T04:00:10.554414+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-01-16T04:00:10.554639+00:00 app[web.1]: npm ERR! Failed at the Missionary-Expediters-Web-Application# start script.
2018-01-16T04:00:10.559460+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-01-16T04:00:10.559334+00:00 app[web.1]:
2018-01-16T04:00:10.554754+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-01-16T04:00:10.559520+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-01-16T04_00_10_556Z-debug.log
Any suggestions on how to get the app up and running? It works on localhost
It shouldn't be a problem with the node version, because Meteor I know supports 8.9.3, and 8.9.4 shouldn't be significantly different.
If you read the dump above you'll see these lines:
2018-01-16T04:00:05.168910+00:00 app[web.1]: npm ERR! errno ENOENT
2018-01-16T04:00:05.162754+00:00 app[web.1]: sh: 1: meteor: not found
2018-01-16T04:00:05.171081+00:00 app[web.1]: npm ERR! spawn ENOENT
Which is telling you that the command meteor is not found - perhaps you didn't install meteor to your heroku instance ? There is a guide here on how to set up Heroku - did you do something like that already?
https://medium.com/#leonardykris/how-to-run-a-meteor-js-application-on-heroku-in-10-steps-7aceb12de234
See section 5:
Set a Meteor buildpack for your Heroku instance
heroku buildpacks:set https://github.com/AdmitHub/meteor-buildpack-horse.git
What is a buildpack? It’s a collection of scripts that prepares your
code for execution by the Heroku dyno manager. Heroku’s cedar stack
has no default language/framework support, so we use a buildpack to
determine/specify what kind of framework we wanted to build on.
What is cedar then? It’s a polyglot environment, which means it has
native support for many popular languages and frameworks (e.g. Rails,
Node.js, Java, PHP). It also serves as Heroku’s default runtime stack
(cedar-14).