Skip to content

Unable to deploy Parse Server to Heroku #7090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
6 tasks
grassland-curing-cfa opened this issue Dec 22, 2020 · 11 comments
Closed
6 tasks

Unable to deploy Parse Server to Heroku #7090

grassland-curing-cfa opened this issue Dec 22, 2020 · 11 comments
Labels
type:question Support or code-level question

Comments

@grassland-curing-cfa
Copy link

grassland-curing-cfa commented Dec 22, 2020

New Issue Checklist

Issue Description

Deployment of my Parser Server to Heroku stopped working due to the following error on the console.

I have a Parse Server web app deployed on Heroku. It has been updated for a few months though. After I updated the cloud code in main.js, I tried to push the changes to Heroku but received the following error message. Building of web app failed. I am unable to tell if this was the issue with Heroku or the current version of Parse Server.

_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): >=4.3
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version >=4.3...
remote: Downloading and installing node 15.4.0...
remote: Using default npm version: 7.0.15
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
remote: npm ERR! code 1
remote: npm ERR! git dep preparation failed
remote: npm ERR! command /tmp/build_6934a37f/.heroku/node/bin/node /tmp/build_6934a37f/.heroku/node/lib/node_modules/npm/bin/npm-cli.js install --cache=/tmp/npmcache.Hlup5/_cacache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
remote: npm ERR! > codemirror-graphql@0.6.12 prepublish
remote: npm ERR! > . ./resources/prepublish.sh
remote: npm ERR! [eval]:1
remote: npm ERR! process.exit(().original.length && ().original[0].indexOf('pu') === 0)
remote: npm ERR! ^
remote: npm ERR!
remote: npm ERR! SyntaxError: Unexpected token ')'
remote: npm ERR! at new Script (node:vm:101:7)
remote: npm ERR! at createScript (node:vm:262:10)
remote: npm ERR! at Object.runInThisContext (node:vm:310:10)
remote: npm ERR! at node:internal/process/execution:77:19
remote: npm ERR! at [eval]-wrapper:6:22
remote: npm ERR! at evalScript (node:internal/process/execution:76:60)
remote: npm ERR! at node:internal/main/eval_string:23:3
remote: npm ERR!
remote: npm ERR!
remote: npm ERR!
remote: npm ERR! Only Travis CI can publish to NPM.
remote: npm ERR! Ensure git is left is a good state by backing out any commits and deleting any tags.
remote: npm ERR! Then read CONTRIBUTING.md to learn how to publish to NPM.
remote: npm ERR!
remote: npm ERR!
remote: npm ERR!
remote: npm ERR! npm ERR! code 1
remote: npm ERR! npm ERR! path /tmp/npmcache.Hlup5/_cacache/tmp/git-clone-5caf527a
remote: npm ERR! npm ERR! command failed
remote: npm ERR! npm ERR! command sh -c . ./resources/prepublish.sh
remote: npm ERR!
remote: npm ERR! npm ERR! A complete log of this run can be found in:
remote: npm ERR! npm ERR! /tmp/npmcache.Hlup5/_cacache/_logs/2020-12-22T05_52_41_487Z-debug.log
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.Hlup5/logs/2020-12-22T05_52_41_912Z-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: - Dangerous semver range (>) in engines.node
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 mywebapp-parse-server.
remote:
To https://git.heroku.com/MY_APP.git
! [remote rejected] master -> master (pre-receive hook declined)

My package.json file looks like:
{
"name": "parse-server-example",
"version": "1.4.0",
"description": "An example Parse API server using the parse-server module",
"author": "AC",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://git.heroku.com/{MY_APP}.git"
},
"license": "MIT",
"dependencies": {
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.16.0",
"http-errors": "~1.6.2",
"morgan": "~1.9.0",
"parse-dashboard": "^1.2.0",
"parse-server": "",
"cors": "
",
"cron": "^1.8.2"
},
"scripts": {
"start": "node index.js"
},
"engines": {
"node": ">=4.3"
}
}

Steps to reproduce

Actual Outcome

Push to Heroku rejected, failed to compile Node.js app.

Expected Outcome

Failing Test Case / Pull Request

  • 🤩 I submitted a PR with a fix and a test case.
  • 🧐 I submitted a PR with a failing test case.

Environment

Heroku

Server

  • Parse Server version: Latest. No idea which version I am on.
  • Operating system: Node on Heroku
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Heroku

Database

  • System (MongoDB or Postgres): MongoDB on Atlas
  • Database version: 4.2
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JavaScript
  • SDK version: 2

Logs

@grassland-curing-cfa
Copy link
Author

The same error was still thrown even if I changed NODE_MODULES_CACHE=false.

@dplewis
Copy link
Member

dplewis commented Dec 22, 2020

remote: Downloading and installing node 15.4.0...
remote: Using default npm version: 7.0.15

Looks like Heroku tried to use Node 15. Can you specify a specific Node version in your package.json -> engines -> node?

  "engines": {
    "node": "14.9.0",
    "npm": "6.14.8"
  },

@grassland-curing-cfa
Copy link
Author

Thanks @dplewis.
This worked!
Can you advise where information about compatibility between Parse-Server and Node & npm across different versions can be found?

@dplewis
Copy link
Member

dplewis commented Dec 22, 2020

The test suite runs against Node 10 and Node 12. Node 14 is the active LTS (Long Term Support) version and this repo works for it.

The current Node version is 15 was released 2 months ago. Usually the new Node versions are released for 6 Months to allow developers enough time to add support before it is moved into LTS.

@grassland-curing-cfa
Copy link
Author

Many thanks @dplewis

@cjbland
Copy link
Contributor

cjbland commented Feb 20, 2021

I hate to revive a closed thread, but I'm running into this exact issue using npm 7.5.4 and node 14. Could this an issue with the new major version of npm? I'm currently using parse-server 4.5.0

EDIT: Removing package-lock.json gives me a bunch of Could not resolve dependency which I tracked back to parse-dashboard. Removing parse-dashboard installs successfully using npm 7.5.4. My comment about it being related to npm 7.5.4 is wrong but wanted to leave this comment in case anyone else comes across this.

@mtrezza
Copy link
Member

mtrezza commented Feb 20, 2021

Please see the Node.js compatibility table and ensure that you are using a compatible version. If the issue still exists, you could search through existing issues and if you cannot find a solution, you could open a new issue and fill out a new issue template.

@stage88
Copy link
Contributor

stage88 commented Mar 3, 2021

Hi guys, I am also getting this issue. I am using NodeJS 14 and NPM 7. I only started getting errors once I switched to NPM 7, npm install fails:

/Projects/xxx/xxx-server(development*) » npm install --legacy-peer-deps                                                                    xxx
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'xxx-server@0.0.4',
npm WARN EBADENGINE   required: { node: '8.1.1' },
npm WARN EBADENGINE   current: { node: 'v14.16.0', npm: '7.6.0' }
npm WARN EBADENGINE }
npm WARN deprecated cryptiles@4.1.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated boom@7.3.0: This module has moved and is now available at @hapi/boom. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated mailcomposer@4.0.2: This project is unmaintained
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated graphql-import@0.4.5: GraphQL Import has been deprecated and merged into GraphQL Tools, so it will no longer get updates. Use GraphQL Tools instead to stay up-to-date! Check out https://www.graphql-tools.com/docs/migration-from-import for migration and https://the-guild.dev/blog/graphql-tools-v6 for new changes.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated buildmail@4.0.1: This project is unmaintained
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/sam/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! > codemirror-graphql@0.6.12 prepublish
npm ERR! > . ./resources/prepublish.sh
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated fsevents@1.1.2: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! npm WARN deprecated is-buffer@1.1.5: This version of 'is-buffer' is out-of-date. You must update to v1.1.6 or newer
npm ERR! npm WARN deprecated request-promise-native@1.0.4: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm ERR! npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3
npm ERR! npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! npm WARN deprecated babel-eslint@7.2.3: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm ERR! npm WARN deprecated graphql-import@0.1.9: GraphQL Import has been deprecated and merged into GraphQL Tools, so it will no longer get updates. Use GraphQL Tools instead to stay up-to-date! Check out https://www.graphql-tools.com/docs/migration-from-import for migration and https://the-guild.dev/blog/graphql-tools-v6 for new changes.
npm ERR! npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm ERR! npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm ERR! npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm ERR! npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! npm WARN deprecated request@2.81.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated har-validator@4.2.1: this library is no longer supported
npm ERR! npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm ERR! npm WARN deprecated core-js@2.5.0: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! [eval]:1
npm ERR! process.exit(().original.length && ().original[0].indexOf('pu') === 0)
npm ERR!               ^
npm ERR! 
npm ERR! SyntaxError: Unexpected token ')'
npm ERR!     at new Script (vm.js:101:7)
npm ERR!     at createScript (vm.js:262:10)
npm ERR!     at Object.runInThisContext (vm.js:310:10)
npm ERR!     at internal/process/execution.js:77:19
npm ERR!     at [eval]-wrapper:6:22
npm ERR!     at evalScript (internal/process/execution.js:76:60)
npm ERR!     at internal/main/eval_string.js:23:3
npm ERR! 
npm ERR! 
npm ERR! 
npm ERR!    Only Travis CI can publish to NPM. 
npm ERR!   Ensure git is left is a good state by backing out any commits and deleting any tags.
npm ERR!   Then read CONTRIBUTING.md to learn how to publish to NPM.
npm ERR! 
npm ERR! 
npm ERR! 
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/sam/.npm/_cacache/tmp/git-clone-519ad542
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c . ./resources/prepublish.sh
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /Users/sam/.npm/_logs/2021-03-03T11_07_48_759Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sam/.npm/_logs/2021-03-03T11_07_54_226Z-debug.log
----------------------------------------------------------------------------------------------------------------------------------------------------------------
~/Projects/xxx/xxx-server(development*) » node --version                                                                                1 ↵ xxx
v14.16.0
----------------------------------------------------------------------------------------------------------------------------------------------------------------
~/Projects/xxx/xxx-server(development*) » npm --version                                                                                     xxx
7.6.0
----------------------------------------------------------------------------------------------------------------------------------------------------------------
~/Projects/xxx/xxx-server(development*) »   

@mtrezza
Copy link
Member

mtrezza commented Mar 3, 2021

@stage88 Are you getting these errors related to Parse Server or Parse Dashboard?

If it is Parse Dashboard, please take a look at parse-community/parse-dashboard#1633. Parse Dashboard currently does not install with npm 7.

@stage88
Copy link
Contributor

stage88 commented Mar 3, 2021

Ok, so according to this page https://github.com/npm/rfcs/blob/latest/implemented/0021-reduce-lifecycle-script-environment.md, $npm_config_argv has been removed and is not set anymore in NPM 7.

This script here https://github.com/graphql/graphiql/blob/v0.6.12/resources/prepublish.sh depends on it and it fails... sigh

I tried setting it manually npm_config_argv='{original: ""}', and it looks like that didn't help. Not sure how to resolve this, but looks like i'll have to downgrade to NPM 6. Should be ok until next Node LTS when NPM 7 becomes default???

@stage88
Copy link
Contributor

stage88 commented Mar 3, 2021

Oh, I see, it is Parse Dashboard. Ok thanks, sorry...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

5 participants