I was trying to deploy my node application in heroku and i am getting this error
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching set buildpack https://github.com/jasonswett/heroku-buildpack-nodejs... done
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 4.4.0
remote: engines.npm (package.json): 3.9.6
remote:
remote: Downloading and installing node 4.4.0...
remote: Downloading and installing npm 3.9.6 (replacing version 2.14.20)...
remote:
remote: -----> Restoring cache
remote: Skipping cache restore (new runtime signature)
remote:
remote: -----> Building dependencies
remote: Pruning any extraneous modules
remote: Installing node modules (package.json)
remote: npm ERR! fetch failed https://registry.npmjs.org/escape-regexp/-/escape-regexp-0.0.1.tgz
remote: npm ERR! fetch failed https://registry.npmjs.org/escape-regexp/-/escape-regexp-0.0.1.tgz
remote: npm ERR! fetch failed https://registry.npmjs.org/escape-regexp/-/escape-regexp-0.0.1.tgz
remote: npm ERR! Linux 3.13.0-91-generic
remote: npm ERR! argv "/tmp/build_27e444d734bb50f3b3df0b13bc50d093/client/.heroku/node/bin/node" "/tmp/build_27e444d734bb50f3b3df0b13bc50d093/client/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_27e444d734bb50f3b3df0b13bc50d093/client/.npmrc"
remote: npm ERR! node v4.4.0
remote: npm ERR! npm v3.9.6
remote:
remote: npm ERR! fetch failed with status code 502
remote: npm ERR!
remote: npm ERR! If you need help, you may report this error at:
remote: npm ERR! <https://github.com/npm/npm/issues>
remote:
remote: npm ERR! Please include the following file with any support request:
remote: npm ERR! /tmp/build_27e444d734bb50f3b3df0b13bc50d093/client/npm-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:
remote: ! Push rejected, failed to compile Node.js app
remote:
I tried logging into heroku bash using heroku run bash command
and tried this
~ $ wget https://registry.npmjs.org/escape-regexp/-/escape-regexp-0.0.1.tgz
--2016-07-06 07:13:55-- https://registry.npmjs.org/escape-regexp/-/escape-regexp-0.0.1.tgz
Resolving registry.npmjs.org (registry.npmjs.org)... 151.101.20.162
Connecting to registry.npmjs.org (registry.npmjs.org)|151.101.20.162|:443... connected.
HTTP request sent, awaiting response... 502 Bad Gateway
2016-07-06 07:13:55 ERROR 502: Bad Gateway.
What does this 502 bad gateway mean, In my local if i try to get this package its working
P.S In heroku all other urls i was able to access
~ $ wget https://registry.npmjs.org/
--2016-07-06 08:08:53-- https://registry.npmjs.org/
Resolving registry.npmjs.org (registry.npmjs.org)... 151.101.20.162
Connecting to registry.npmjs.org (registry.npmjs.org)|151.101.20.162|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 262 [text/plain]
Saving to: ‘index.html’
100%[===========================================================================================================================================>] 262 --.-K/s in 0s
2016-07-06 08:08:54 (45.8 MB/s) - ‘index.html’ saved [262/262]
There's an open issue at NPM for this:
https://github.com/npm/npm/issues/13284
This problem is also occurring on CodeShip. I think its a NPM issue
Related
I've been following brad traversy's guide for hosting a full stack mern app ,
But after I run git push heroku master I keep getting this error :
$ git push heroku master
Enumerating objects: 39, done.
Counting objects: 100% (39/39), done.
Delta compression using up to 8 threads
Compressing objects: 100% (36/36), done.
Writing objects: 100% (39/39), 427.21 KiB | 8.06 MiB/s, done.
Total 39 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
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): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.x...
remote: Downloading and installing node 12.20.1...
remote: Using default npm version: 6.14.10
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote:
remote: > nodemon#2.0.6 postinstall /tmp/build_a03a558d/node_modules/node
mon
remote: > node bin/postinstall || exit 0
remote:
remote: Love nodemon? You can now support the project via the open collec
tive:
remote: > https://opencollective.com/nodemon/donate
remote:
remote: added 296 packages in 4.302s
remote:
remote: -----> Build
remote: Detected both "build" and "heroku-postbuild" scripts
remote: Running heroku-postbuild
remote:
remote: > server#1.0.0 heroku-postbuild /tmp/build_a03a558d
remote: > NPM_CONFIG_PRODUCTION=false npm install --prefix frontend && np
m run build --prefix frontend
remote:
remote: up to date in 0.241s
remote: found 0 vulnerabilities
remote:
remote: npm ERR! code ENOENT
remote: npm ERR! syscall open
remote: npm ERR! path /tmp/build_a03a558d/frontend/package.json
remote: npm ERR! errno -2
remote: npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_a03a
558d/frontend/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.ZT0se/_logs/2021-01-26T16_52_50_692Z-debug.lo
g
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 254
remote: npm ERR! server#1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm
install --prefix frontend && npm run build --prefix frontend`
remote: npm ERR! Exit status 254
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 additi
onal logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.ZT0se/_logs/2021-01-26T16_52_50_713Z-debug.lo
g
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common is
sues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploy
s
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 fathomless-thicket-55387.
remote:
To https://git.heroku.com/fathomless-thicket-55387.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/fathomless-thicket-55
387.git'
I have no clue why I get those error messages...
remote: npm ERR! path /tmp/build_a03a558d/frontend/package.json
remote: npm ERR! errno -2
remote: npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_a03a
558d/frontend/package.json'
You need to check
Whether you have package.json file in frontend folder. You can in git and see if it is there. It may be mentioned in gitignore.
Whether your heroku-postbuild runs from package.json (not the same package.json file you have in frontend folder) which is on the same level with folder frontend. Like this:
package.json
/frontend
I have seen many people get this error, and I've tried every solution I've seen suggested so far. Checking if Heroku knows what kind of app it is, removing .git file from my client folder and so on. In the error message, I can see it is having trouble finding the files, but I don't know how I'd fix this as I did git add -A and git add . numerous time. I am a beginning and I am not sure what I'm missing.
This is the error message when I do git push heroku master:
Counting objects: 100% (13/13), done.
Delta compression using up to 8 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (13/13), 13.79 KiB | 1009.00 KiB/s, done.
Total 13 (delta 0), reused 0 (delta 0), pack-reused 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.18.3...
remote: Using default npm version: 6.14.6
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote: added 131 packages in 5.646s
remote:
remote: -----> Build
remote: Running heroku-postbuild
remote:
remote: > mern_project#1.0.0 heroku-postbuild /tmp/build_07c4cff9
remote: > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
remote:
remote: up to date in 0.242s
remote: found 0 vulnerabilities
remote:
remote: npm ERR! code ENOENT
remote: npm ERR! syscall open
remote: npm ERR! path /tmp/build_07c4cff9/client/package.json
remote: npm ERR! errno -2
remote: npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_07c4cff9/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.LOFwn/_logs/2020-08-28T19_01_14_938Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 254
remote: npm ERR! mern_project#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 mern_project#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.LOFwn/_logs/2020-08-28T19_01_14_958Z-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 floating-island-87176.
remote:
To https://git.heroku.com/floating-island-87176.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/floating-island-87176.git'
Add engines in package.json file
"engines": {
"node": "16.13.0",
"npm": "8.1.0"
},
Then, change version of the package.json
"version":"1.2.1"
Then
git push heroku master
As found in this github issue it was an error with the git repo still thinking client was a submodule. The fix is to remove the client folder from git tracking and add it back as regular files:
git rm -f --cached client && git add . && git commit -m 'Add client folder back to git repo' && git push heroku master
This is what worked for me (The branch is based on 'origin/master', but the upstream might be gone.
(use "git branch --unset-upstream" to fixup))
git branch --unset-upstream
Anyone have any ideas what the issue here is, it seems to be evaluating my npm registry to False. I am installing packages from a private scope.
I have added an .npmrc file as well and added
#scope:registry=https://registry.npm.org
//registry.npmjs.org/:_authToken=${NPM_PRIVATE_TOKEN}
When I echo the variable from heroku in my console I see that NPM_PRIVATE_TOKEN is already set
heroku config:get NPM_PRIVATE_TOKEN --app xxxxx
xxxx-xxxx-xxxx-xxx-xxxxxxxx
Total 530 (delta 244), reused 331 (delta 140)
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=False
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 12.x.x
remote: engines.npm (package.json): 6.x.x
remote:
remote: Resolving node version 12.x.x...
remote: Downloading and installing node 12.18.4...
remote: Bootstrapping npm 6.x.x (replacing 6.14.6)...
remote: npm 6.x.x installed
remote:
remote: -----> Installing dependencies
remote: Installing node modules (package.json)
remote: npm ERR! code E404
remote: npm ERR! 404 Not Found - GET https://registry.npmjs.org/False - Not found
remote: npm ERR! 404
remote: npm ERR! 404 'False#latest' is not in the npm registry.
remote: npm ERR! 404 Your package name is not valid, because
remote: npm ERR! 404 1. name can no longer contain capital letters
remote: npm ERR! 404
remote: npm ERR! 404 Note that you can also install from a
remote: npm ERR! 404 tarball, folder, http url, or git url.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.QbXAj/_logs/2020-09-24T17_46_48_753Z-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
rem
Well this was a silly error on my part I was setting my env variables and accidentally set
NPM_CONFIG_PRODUCTION to False instead of false.
Here is the error log:
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): ~6.11.0
remote: engines.npm (package.json): ~5.0.3
remote:
remote: Resolving node version ~6.11.0 via semver.io...
remote: Downloading and installing node 6.11.1...
remote: Resolving npm version ~5.0.3 via semver.io...
remote: Downloading and installing npm 5.0.4 (replacing version
3.10.10)...
remote:
remote: -----> Restoring cache
remote: Skipping cache restore (new-signature)
remote:
remote: -----> Building dependencies
remote: Prebuild detected (node_modules already exists)
remote: Rebuilding any native modules
remote: npm ERR! path
/tmp/build_9c402097d0e7567eccf5e236dc7f0959/node_modules/jade/bin/jade.js
remote: npm ERR! code ENOENT
remote: npm ERR! errno -2
remote: npm ERR! syscall chmod
remote: npm ERR! enoent ENOENT: no such file or directory, chmod
'/tmp/build_9c402097d0e7567eccf5e236dc7f0959/node_modules/jade/bin/jade.js'
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! /app/.npm/_logs/2017-07-16T02_45_14_132Z-
debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot
common issues here:
remote:
remote: Some possible problems:
remote:
remote: - node_modules checked into source control
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 pacific-harbor-25184.
remote:
To https://git.heroku.com/pacific-harbor-25184.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pacific-harbor-25184.git'
How can I get past this build error when deploying to heroku? (even though it works locally)
This is similar to a recent issue in cloudfoundry (but the same idea applies to heroku as well)
Male sure, in your local project, to ignore node_modules first:
echo 'node_modules' >> .gitignore
git rm -r --cached node_modules
git commit -m "ignore node_modules"
Then try your heroku deploy again.
I'm having problems pushing to Heroku. This is happening on my first "Git push Heroku Master." I'm using Node JS.
The error I am getting is as follows:
Take a look at the entire error log below. Please let me know where I am going wrong while attempting to push my project to Heoku.
andrewleonardi:~/workspace/HelpMeRV/V1 (master) $ git push heroku master
Counting objects: 39, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (35/35), done.
Writing objects: 100% (39/39), 11.80 KiB | 0 bytes/s, done.
Total 39 (delta 3), 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: 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.1.1
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Downloading and installing node 4.1.1...
remote: Using default npm version: 2.14.4
remote:
remote: -----> Restoring cache
remote: Skipping cache restore (new runtime signature)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json)
remote:
remote: > deasync#0.1.9 install /tmp/build_7c427b7600b55b6ea32823b63fa7f741/node_modules/locus/node_modules/deasync
remote: > node ./build.js
remote:
remote: `linux-x64-node-4` exists; testing
remote: Binary is fine; exiting
remote:
remote: > nodewebkit#0.11.6 postinstall /tmp/build_7c427b7600b55b6ea32823b63fa7f741/node_modules/nodewebkit
remote: > node scripts/install.js
remote:
remote: stream.js:74
remote: throw er; // Unhandled stream error in pipe.
remote: ^
remote:
remote: Error: invalid tar file
remote: at Extract.Parse._startEntry (/tmp/build_7c427b7600b55b6ea32823b63fa7f741/node_modules/nodewebkit/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js:145:13)
remote: at Extract.Parse._process (/tmp/build_7c427b7600b55b6ea32823b63fa7f741/node_modules/nodewebkit/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js:127:12)
remote: at BlockStream.<anonymous> (/tmp/build_7c427b7600b55b6ea32823b63fa7f741/node_modules/nodewebkit/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js:47:8)
remote: at emitOne (events.js:77:13)
remote: at BlockStream.emit (events.js:169:7)
remote: at BlockStream._emitChunk (/tmp/build_7c427b7600b55b6ea32823b63fa7f741/node_modules/nodewebkit/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js:145:10)
remote: at BlockStream.resume (/tmp/build_7c427b7600b55b6ea32823b63fa7f741/node_modules/nodewebkit/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js:58:15)
remote: at Extract.Reader.resume (/tmp/build_7c427b7600b55b6ea32823b63fa7f741/node_modules/nodewebkit/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js:255:34)
remote: at DirWriter.<anonymous> (/tmp/build_7c427b7600b55b6ea32823b63fa7f741/node_modules/nodewebkit/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js:57:8)
remote: at emitNone (events.js:67:13)
remote: npm ERR! Linux 3.13.0-112-generic
remote: npm ERR! argv "/tmp/build_7c427b7600b55b6ea32823b63fa7f741/.heroku/node/bin/node" "/tmp/build_7c427b7600b55b6ea32823b63fa7f741/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_7c427b7600b55b6ea32823b63fa7f741/.npmrc"
remote: npm ERR! node v4.1.1
remote: npm ERR! npm v2.14.4
remote: npm ERR! code ELIFECYCLE
remote:
remote: npm ERR! nodewebkit#0.11.6 postinstall: `node scripts/install.js`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the nodewebkit#0.11.6 postinstall script 'node scripts/install.js'.
remote: npm ERR! This is most likely a problem with the nodewebkit package,
remote: npm ERR! not with npm itself.
remote: npm ERR! Tell the author that this fails on your system:
remote: npm ERR! node scripts/install.js
remote: npm ERR! You can get their info via:
remote: npm ERR! npm owner ls nodewebkit
remote: npm ERR! There is likely additional logging output above.
remote:
remote: npm ERR! Please include the following file with any support request:
remote: npm ERR! /tmp/build_7c427b7600b55b6ea32823b63fa7f741/npm-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 frozen-escarpment-22835.
remote:
To https://git.heroku.com/frozen-escarpment-22835.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/frozen-escarpment-22835.git'
Looking at the package there are a few other open issues with the same issue you are having.
However, you may want to checkout the big ATTENTION label in the readme and try updating to the latest renamed version and see if you have the same issue
ATTENTION
node-webkit was renamed to nw.js as of version 0.12.0. The new and
official installer for nw.js is now npm install nw and the repo is
located at github.com/nwjs/npm-installer
All future releases >= 0.12.0 will be released through nw.
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/new-cv-meker.git'
find this line in your code : Two different lockfiles found: package-lock.json and yarn.lock
And Delete Your yarn.lock file and also uninstall package