Can't push my node.js app to Heroku - node.js

I can't seem to push my updated repository to Heroku. It worked before and the app is live right now on Heroku, but I can't push updates to it.
I've tried npm update, bower update, reinstalling Heroku-toolbelt, pushing while on a different network, pulling from heroku master, and force pushing to heroku master, git pull --rebase, npm cache clean, bower cache clean, uninstalling karma, updating npm on heroku and cleaning the cache on heroku.
I have multiple Heroku accounts which I manage with Heroku Accounts (https://github.com/ddollar/heroku-accounts) as well as multiple git accounts, but I made sure I was on the correct ones.
Here is the last few lines from the terminal before failing to push:
3530 verbose rebuildBundles 'npmconf',
3530 verbose rebuildBundles 'rimraf',
3530 verbose rebuildBundles 'which' ]
3531 info install phantomjs#1.9.7-5
3532 verbose unsafe-perm in lifecycle true
3533 info phantomjs#1.9.7-5 Failed to exec install script
3534 error phantomjs#1.9.7-5 install: `node install.js`
3534 error Exit status 1
3535 error Failed at the phantomjs#1.9.7-5 install script.
3535 error This is most likely a problem with the phantomjs package,
3535 error not with npm itself.
3535 error Tell the author that this fails on your system:
33535 error node install.js
3535 error You can get their info via:
3535 error npm owner ls phantomjs
3535 error There is likely additional logging output above.
3536 error System Linux 3.8.11-ec2
3537 error command "/tmp/build_4600dbd4-687a-4b9c-bf9a-71e3baf5a1c4/vendor/node/bin/node" "/tmp/build_4600dbd4-687a-4b9c-bf9a-71e3baf5a1c4/vendor/node/bin/npm" "rebuild"
3538 error cwd /tmp/build_4600dbd4-687a-4b9c-bf9a-71e3baf5a1c4
3539 error node -v v0.10.29
3540 error npm -v 1.4.14
3541 error code ELIFECYCLE
3542 verbose exit [ 1, true ]
! Push rejected, failed to compile Node.js app
To git#heroku.personal:myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.personal:myapp.git'
Any help is appreciated. Thanks!

After I didn't get any answers here on StackOverflow, I posted my question on Heroku support.
The problem was coming from phantomjs, I removed it from my dependencies and moved it to devDependencies. After that, I purged my build cache using the heroku-repo plugin https://github.com/heroku/heroku-repo
Then I could push to Heroku again

Related

Getting error on npm install as npm ERR cb() never called

I have set a proxy in npm global config. On installing any package I am getting following error.
Below is my node and npm version:
npm: 6.13.4
node: v12.16.1
As I am behind proxy, what else is required to overcome this issue. Every help will be appreciated.
I have also tried by updating node version, removing and after restart setting proxy again, but none of that worked.
C:\test>npm i level-db-helper
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-03-03T04_51_02_995Z-debug.log
C:\test>npm get proxy
http://my-proxy.com:8080
C:\test>npm get https-proxy
http://my-proxy.com:8080
C:\test>
Below is my log file content
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'i',
1 verbose cli 'level-db-helper'
1 verbose cli ]
2 info using npm#6.13.4
3 info using node#v12.16.1
4 verbose npm-session b2d05546852e6399
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 timing npm Completed in 3615ms
8 error cb() never called!
9 error This is an error with npm itself. Please report this error at:
10 error <https://npm.community>
Finally I found the culprit of this issue by my own research, It was due to inaccessible proxy url, so after changing the npm proxy and https-proxy by following command I resolved this issue.
(You need administrative rights to execute this command)
npm config set proxy http://your-proxy-url.com:PORT_NUMBER
npm config set https-proxy http://your-proxy-url.com:PORT_NUMBER
One of the reasons for this issue is that you have package-lock.json file in your project directory. So, you may have to delete or rename the package-lock.json file from the directory and then run the npm install command. Best option is to delete this file.
Hope it will work for you.
I got the same error when, npm install from docker.
deleted the un-used docker images, using the following commands
docker image prune
docker image rm <imageId>
It solved the issue for me

Heroku gives me webpack and node js error on push

Heroku gives me errors suddenly,
It worked fine for about a month with same settings, yesterday after editing some minor things in the project and uploading to git it gave me error when pushing to heroku master:
Creating an optimized production build...
Failed to compile.
./src/sections/welcome/welcome.css
Error: Didn't get a result from child compiler
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ghvinieri#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ghvinieri#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.KO8no/_logs/2019-03-20T10_43_07_497Z-debug.log
-----> Change to Node.js build process
Heroku has begun executing the "build" script defined in package.json
during Node.js builds.
Read more: https://devcenter.heroku.com/changelog-items/1573
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
I tried putting node version in package.json, deleting package.json, node_modules are included in gitigonre, even tried to copy repo from heroku master which contained older code that works on heroku right now, then editing it and uploading; it still gives error, it makes no sense to me. it works on heroku right now with the same settings though when I upload with a minor change it gives errors. could anyone help me with this? Im stuck, looked up all possible solutions none of them work.

NPM Install fails - fsevents

I'm unable to get npm installed correctly in my laravel project. I'm running laravel on a vagrant box (ubuntu-trusty-64). When I run 'npm install' I get the first error in my pastebin (linked below). I then found somewhere below that I should run it without symlinks when using a vagrant box on a windows host os so I then ran 'npm install --no-bin-links' and I was still getting the first error. So then with some help I ran 'rm -rf node_modules' then ran the 'npm install --no-bin-links' and it appears to work but hangs see second half of the pastebin.
Please help!
pastebin: https://pastebin.com/wuRkjqi6
Update:
Just to update everyone on the status, I completely removed npm and reinstalled it following:
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
for node.js 8
I then ran 'sudo npm install --no-bin-links --verbose' directly from the host vm via virtualbox bypassing the vagrant ssh; but it still bombs out on me; this time with an error. but still surrounding fsevents.
27990 info lifecycle vue#2.4.2~postinstall: vue#2.4.2
27991 verbose unlock done using /home/vagrant/.npm/_locks/staging-71408633a969dee2.lock for /home/vagrant/projects/MusekClub/node_modules/.staging
27992 verbose stack Error: ETXTBSY: text file is busy, rmdir '/home/vagrant/projects/MusekClub/node_modules/fsevents/node_modules'
27993 verbose cwd /home/vagrant/projects/MusekClub
27994 verbose Linux 3.13.0-125-generic
27995 verbose argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--no-bin-links" "--verbose"
27996 verbose node v8.2.1
27997 verbose npm v5.3.0
27998 error path /home/vagrant/projects/MusekClub/node_modules/fsevents/node_modules
27999 error code ETXTBSY
28000 error errno -26
28001 error syscall rmdir
28002 error ETXTBSY: text file is busy, rmdir '/home/vagrant/projects/MusekClub/node_modules/fsevents/node_modules'
28003 verbose exit [ -26, true ]
Lastly I tried rebuilding the vagrant box from scratch this morning and when I re-ran 'sudo npm install --no-bin-links --verbose' from the virtualbox host I get the following:
vagrant#vagrant-ubuntu-trusty-64:~/projects/MusekClub$ sudo npm install
npm ERR! path /home/vagrant/projects/MusekClub/node_modules/fsevents/build/Release/.deps/User/eshanker/Code/fsevents/lib
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rmdir
npm ERR! ETXTBSY: text file is busy, rmdir '/home/vagrant/projects/MusekClub/node_modules/fsevents/build/Release/.deps/Users/eshanker/Code/fsevents/lib'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2017-08-09T12_45_58_590Z-debug.log
I removed the standard dependencies from the default laravel 5.4 package.json file. I then installed each one, one by one. I found that my issue only occurs when installing the "laravel-mix": "^1.0" dependency line.
I was able to overcome my issue by ditching npm and utilizing yarn. Seems to get past the fsevents module as reading it as an optional dependency. Given what I've researched it appears that fsevents isn't supported on linux anyways.
vagrant#vagrant-ubuntu-trusty-64:~/projects/MusekClub$ sudo yarn install
yarn install v0.27.5
Resolving packages...
Fetching packages...
warning fsevents#1.1.2: The platform "linux" is incompatible with this module.
info "fsevents#1.1.2" is an optional dependency and failed compatibility check.
Excluding it from installation.
Linking dependencies...
Building fresh packages...
Done in 67.15s.
npm install --no-optional helped me, but it is merely dodging the problem.
Using vagrant I was able to get around this by removing --node-bin-links and running my vagrant box as admin. I'm using roughly the same versions of node and npm.

Ignoring fsevents dependency while deploying

I developed a little Node.JS app using my macbook. Everything is fine and I'm going to deploy it to Heroku.
git push heroku master command exits with an error:
9045 info install fsevents#0.2.1
9046 verbose unsafe-perm in lifecycle true
9047 info fsevents#0.2.1 Failed to exec install script
9048 error fsevents#0.2.1 install: `node-gyp rebuild`
9048 error Exit status 1
9049 error Failed at the fsevents#0.2.1 install script.
9049 error This is most likely a problem with the fsevents package,
9049 error not with npm itself.
9049 error Tell the author that this fails on your system:
9049 error node-gyp rebuild
9049 error You can get their info via:
9049 error npm owner ls fsevents
9049 error There is likely additional logging output above.
9050 error System Linux 3.8.11-ec2
9051 error command "/tmp/build_531abeef-6dec-47ed-a19d-0a9181d01d8d/vendor/node/bin/node" "/tmp/build_531abeef-6dec-47ed-a19d-0a9181d01d8d/vendor/node/bin/npm" "rebuild"
9052 error cwd /tmp/build_531abeef-6dec-47ed-a19d-0a9181d01d8d
9053 error node -v v0.10.32
9054 error npm -v 1.4.28
9055 error code ELIFECYCLE
9056 verbose exit [ 1, true ]
Google is my friend, and helps me understanding the problem.
fsevents is a NPM module for Native Access to Mac OS-X FSEvents.
It's been installed on my local machine as a grunt-browserify dependency:
./node_modules/grunt-browserify/node_modules/watchify/node_modules/chokidar/node_modules/fsevents
Heroku (linux) does not need nor support it, of course.
How can I "exclude" this fsevents dependency from my deployment to
Heroku?
Finally, I just removed node_modules from my deployment.

Push to Heroku failed - error fsevents#0.2.0 install: `node-gyp rebuild`

I'm trying to push my app to Heroku but I keep getting this error, looks like an issue with node-gyp but no idea how to go about fixing it.
2854 verbose rebuildBundles fsevents#0.2.0
2855 verbose rebuildBundles [ 'nan' ]
2856 info install fsevents#0.2.0
2857 verbose unsafe-perm in lifecycle true
2858 info fsevents#0.2.0 Failed to exec install script
2859 error fsevents#0.2.0 install: `node-gyp rebuild`
2859 error Exit status 1
2860 error Failed at the fsevents#0.2.0 install script.
2860 error This is most likely a problem with the fsevents package,
2860 error not with npm itself.
2860 error Tell the author that this fails on your system:
2860 error node-gyp rebuild
2860 error You can get their info via:
2860 error npm owner ls fsevents
2860 error There is likely additional logging output above.
2861 error System Linux 3.8.11-ec2
2862 error command "/tmp/build_31f84d3a-9303-49cd-9596-cc7e984d9e18/vendor/node/bin/node" "/tmp/build_31f84d3a-9303-49cd-9596-cc7e984d9e18/vendor/node/bin/npm" "rebuild"
2863 error cwd /tmp/build_31f84d3a-9303-49cd-9596-cc7e984d9e18
2864 error node -v v0.10.28
2865 error npm -v 1.4.9
2866 error code ELIFECYCLE
2867 verbose exit [ 1, true ]
! Push rejected, failed to compile Node.js app
fsevents is a Mac OS X only extension and fails to install on Heroku (Linux). Try making the dependency optional using optionalDependencies in package.json.

Resources