Ignoring fsevents dependency while deploying - node.js

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.

Related

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.

cannot install jdbc module in RHEL 6 for my nodejs app

I have been trying to install jdbc in RHEL6 but keeps on getting
error Linux 4.1.17-22.30.amzn1.x86_64
9680 error argv "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm" "--production" "install"
9681 error node v4.3.0
9682 error npm v2.14.12
9683 error code ELIFECYCLE
9684 error java#0.4.7 install: `node-gyp rebuild`
9684 error Exit status 1
9685 error Failed at the java#0.4.7 install script 'node-gyp rebuild'.
9685 error This is most likely a problem with the java package,
9685 error not with npm itself.
9685 error Tell the author that this fails on your system:
9685 error node-gyp rebuild
I am attaching the npm-debug
http://pasted.co/c60c05d2
The install worked prefectly when i tried it on windows 7 .
I am stuck on this for days. Please help
Edit: please find the full logs here npm-debug http://pasted.co/70275c54
nodejs log http://pasted.co/fc4729ea

‘node-gyp rebuild’ installation error when adding a package to meteor app in Windows 7

I was trying to add a package (mizzao:turkserver) to my Meteor application, but I kept getting this error:
mizzao:turkserver: updating npm dependencies -- request, libxmljs,
validator, querystring, async, deepmerge...
gypnpm ERR! Windows_NT 6.1.7601
npm ERR! argv
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\\\node.exe"
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\node_modules\\npm\\bin\\npm-cli.js"
"install" "libxmljs#0.8.1"
npm ERR! node v0.10.36
npm ERR! npm v2.7.3
npm ERR! code ELIFECYCLE
npm ERR! libxmljs#0.8.1 install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the libxmljs#0.8.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.
=> Babel active on file extensions: es6.js, es6, jsx
=> Errors while adding packages:
While building package mizzao:turkserver:
error: couldn't install npm package
I am developing my Meteor application on a Windows 7 machine and from what I have been able to gather from posts on forums, the error seems to be related to that fact (interaction between npm and Windows - I did not find any posts describing the same problem on Linux machines).
I've already tried installing the latest Python version and MS Visual Studio 2013 as suggested here: https://github.com/TooTallNate/node-gyp#installation, as well as setting some environment variables as suggested here: https://github.com/atom/atom/issues/2754. But none of those helped.
Any help would be greatly appreciated!
As I described in this comment, this seems to be an issue with the Python path being set incorrectly for npm, as Meteor's distribution of npm isn't hooking it up correctly. Most Linux distros come with Python, but Windows doesn't, so it is correlated with running Windows.
It can be fixed by making sure that Python is installed, then running the following command:
npm config set python C:\Python27\python.exe
The use of an old libxmljs is because mizzao:turkserver is dependent on a relatively old node MTurk API, which I'd like to wean it off of at some point, but isn't such a high priority at the moment.
See also:
https://github.com/lovell/sharp/issues/163
https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/

npm install: 'bower install' exited with error code 1

I want to programm widgets for XBee ZigBee Cloud Kit.
To do it, I need first to set up everything.
I'm using this guide.
After failing repeatedly the automated setup I started the Manual setup. I did install the Requirements. So everything so far went good until the last point: npm install. I'm getting the following error bower install' exited with error code 1. I'm not sure what to do, I'm not used to PowerShell or any other shell.
After failing the installing I get this errors:
bower justgauge#* ECMDERR Failed to
execute "git ls-remote --tags --heads git://github.c
om/oscarcv/justgage.git", exit code of #128 fatal: remote error:
Repository not found.
Additional error details: fatal: remote error: Repository
not found.
'bower install' exited with error code 1
npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "i nstall"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! xbee-zigbee-cloud-kit#1.0.0 postinstall: node postinstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xbee-zigbee-cloud-kit#1.0.0 postinstall script 'node postinstall.js'.
npm ERR! This is most likely a problem with the xbee-zigbee-cloud-kit package,
npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall.js npm ERR!
You can get their info via:
npm ERR! npm owner ls xbee-zigbee-cloud-kit
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\steim\Desktop\XBeeZigBeeCloudKit-master\npm-debug.log
"This is most likely a problem with the xbee-zigbee-cloud-kit package"
If this is true, in that case I don't know what to do, because I work with this package.
This is the npm-debug.log. (Sorry I can't post the whole log, too many characters).
I'm using a company laptop:
Latitude D820
Windows 7 32 Bit
Windows PowerShell with Administration
I'm grateful for any kind of help. I'm getting headache trying to figure it out.
I could solve it. And can now run the app now localy.
I did this steps to solve the issue:
Deleting justgage in bower.json file.
Using commandline: bower install justgage-official
Using commandline: bower update
The only problem is actually I can't start with foreman start (but it's another issue), instead I use python manage.py runserver 0.0.0.0:5000. After that in browser: http://localhost:5000
Thanks Etan Reisner for the hint and thanks Oscar Costoya for guiding me.

libxmljs: scons command not found

When I was trying to deploy my node.js app (with both nodejitsu and heroku), I got the same errors with libxmljs.
> libxmljs#0.4.1 preinstall /root/tmp/tmp-31613c7bs0y8/build/package/node_modules/twilio/node_modules/libxmljs
> make node
make: scons: Command not found
make: *** [node] Error 127
npm http 200 https://registry.nodejitsu.com/css-stringify
npm http 200 https://registry.nodejitsu.com/css-parse
npm http 200 https://registry.nodejitsu.com/is-promise/-/is-promise-1.0.1.tgz
> libxmljs#0.4.1 preuninstall /root/tmp/tmp-31613c7bs0y8/build/package/node_modules/twilio/node_modules/libxmljs
> make clean
make: scons: Command not found
make: *** [clean] Error 127
npm http GET https://registry.nodejitsu.com/css-stringify/-/css-stringify-1.0.5.tgz
npm http GET https://registry.nodejitsu.com/css-parse/-/css-parse-1.0.4.tgz
npm WARN continuing anyway libxmljs#0.4.1 preuninstall: `make clean`
npm WARN continuing anyway Exit status 2
npm ERR! libxmljs#0.4.1 preinstall: `make node`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the libxmljs#0.4.1 preinstall script.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make node
npm ERR! You can get their info via:
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.
npm ERR! System SunOS 5.11
npm ERR! command "node" "/opt/local/bin/npm" "install" "--loglevel=http"
npm ERR! cwd /root/tmp/tmp-31613c7bs0y8/build/package
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
As you can see, it is failing within libxmljs's 'make node' and 'make clean' as the command 'scons' is not found. I have libxmljs installed in my app's node_modules directory, and 'scons' is located at "/usr/local/bin/scons".
I believe I have to ensure that the location of scons is in the path for the make environment of libxmljs but I don't know how to do that. Any help would be appreciated!
UPDATE: Following the advice from this question (Fail to deploy node.js application to heroku) I added libxmljs to the dependencies in package.json and added node_modules/ to .gitignore, that way heroku could have a look at the dependencies and install them itself. However, the exact same error occurred, which leads me to believe the root of the problem is not with my local environment, but something larger regarding libxmljs?
I was able to resolve my problem, although it wasn't really specifically about libxmljs. I also used the 'twilio' node submodule in my app, but listed its version as '0.0.0' in dependencies. I guess twilio 0.0.0 used libxmljs which wouldn't install when deploying to heroku, so I updated the twilio version number to the actual current version, and everything's good to go!

Resources