Why Can't My AWS instance install node-sass pacakage? - node.js

I made an app using Node and am trying to host it using AWS's Elastic Beanstalk, but it always fails npm install when it reaches node-sass. Here is the error from the logs:
5162 error node-sass#4.5.0 postinstall: node scripts/build.js
5162 error Exit status 1
5163 error Failed at the node-sass#4.5.0 postinstall script 'node scripts/build.js'.
5163 error Make sure you have the latest version of node.js and npm installed.
5163 error If you do, this is most likely a problem with the node-sass package,
5163 error not with npm itself.
5163 error Tell the author that this fails on your system:
5163 error node scripts/build.js
5163 error You can get information on how to open an issue for this project with:
5163 error npm bugs node-sass
5163 error Or if that isn't available, you can get their info via:
5163 error npm owner ls node-sass
5163 error There is likely additional logging output above.
5164 verbose exit [ 1, true ]
And here is my repository: https://github.com/Jacob-Elder/react-socket.io-messaging
This is my aws configuration
I searched this issue and found some people reinstalled node-sass with the '--unsafe-perm' flag, but this doesn't seem to be a permissions issue. I'm new to AWS and coding so any help is much appreciated!

So I also had npm install fail on node-sass. I get roughly the same error message as you, but then a few lines above the lines you mention in the original post, I see this "make: g++: Command not found
make: *** [Release/obj.target/libsass/src/libsass/src/ast.o] Error 127".
Judging from this similar stackexchange post: https://serverfault.com/questions/204893/aws-ec2-and-build-essential,
which in turn points to the AWS docs, you may have to run sudo yum groupinstall "Development Tools" to get some additional binaries

Related

how to fix error when npm install png-img or npm install hermione chai

Basically I'm trying to test out Hermione (refer to tags) but ran into errors:
when I run
npm install hermione chai
I end up getting an error for installing the png-img package that ends up with something like this in the terminal:
gyp ERR! stack Error: `gyp` failed with exit code: 1
I also noticed that gyp wasn't the most up to date:
gyp ERR! node-gyp -v v3.6.2
so I naturally tried to upgrade it by:
npm install -g node-gyp
but when I retried installing hermione I still get same error, more importantly I noticed that node-gyp was still running the same older version.
After digging I also saw suggestion to install png-img by itself, ran into same problem.
Finally found this link
turns out npm has it's own internal bundle of node-gyp and you have to force upgrade it by:
npm explore npm -g -- npm install node-gyp#latest
you may need to use sudo for the above, but I believe I've also read that if you need to run sudo prior to npm commands you may have installed it wrong...

What is npm ERR! code ELIFECYCLE?

I've gotten this same error on two different npm packages and haven't seemed to be able to figure it out. I've checked this answer and I don't have any other servers running. I've also tried deleting my module_packages folder, cleaning npm cache clean and then reinstalling using npm i as many threads have suggested, but I still get the same error.
Windows 10 64bit
Node 8.9.4
npm 5.6.0
C:\Users\hunter\Documents\vid>npm install npm install github:storj/node-libstorj --save
> storj#5.1.0 preinstall C:\Users\hunter\Documents\vid\node_modules\storj
> node ./download.js
Unable to download libstorj for platform: win32 and arch: x64
npm WARN vid#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! storj#5.1.0 preinstall: `node ./download.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the storj#5.1.0 preinstall 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! C:\Users\hunter\AppData\Roaming\npm-cache\_logs\2018-03-25T15_44_06_578Z-debug.log
Any ideas on what might be causing the error would be helpful.
I have good and bad news for you. The good news first: Everythings fine with your computer.
The bad news: The module you would like to install is incompatible with windows operating systems. Have a look at the first line of your error message:
Unable to download libstorj for platform: win32 and arch: x64
There is already an open issue for this problem on GitHub, see: https://github.com/Storj/node-libstorj/issues/43
As mentioned in this issue there are multiple problems:
download/unzip not working
not compiling because some linux-only functions being used (access function)
not linking (it seems nettle and some other link fails)
So you have two options: Wait until this issue gets fixed - or - switch your operating system ;-)
I was getting a "code ELIFECYCLE" error trying to run "usemin" and "imagemin" node-modules via script entries in package.json. These script entries were given in a Coursera "Full Stack Developer" course:
"imagemin": "imagemin img/* -o dist/img/ &&
"usemin": "usemin index.html -d dist -o dist/index.html",
The first line should have read:
"imagemin": "imagemin --out-dir=dist/img/ img/**/*.{png,jpg,git}"
And the issue with usemin giving a "code ELIFECYLE" error was finally traced to the fact that I had installed the API version ("npm install usemin") rather than the cli version ("npm install usemin-cli).
Hope the above helps some other nubbie avoid what now look like an obvious pair of mistakes!

Unable to install mean-cli in linux mint 17 using npm

I have npm, nodejs installed already. But when I try installing the mean-cli (on linux mint 17)I get the following error. From the error it does seem like the install script for mean-cli is using the command 'node' vs 'nodejs' (for linux-mint). I am not sure how to get it to use the right command.
I searched through google and posts related to mean.io here at SO but couldn't find any pertinent info. Any help is appreciated.
sudo npm install -g mean-cli
> mean-cli#0.10.14 preinstall /usr/local/lib/node_modules/mean-cli
> node ./scripts/preinstall
sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! weird error 127
npm ERR! not ok code 0
Install package nodejs-legacy, it is just symlink to nodejs.

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.

npm weird error 135 on using npm start

I am installing Ghost and while installing it I followed the following steps at:
http://docs.ghost.org/installation/linux/
But on running npm start I get the following errors:
> node index
Bus error (core dumped)
npm ERR! weird error 135
npm ERR! not ok code 0
What should I do? I am a newbie to node or npm
According to this site, and this also, there is most likely an environment issue such as an improperly or missing file or configuration setting. Trying in a new, fresh installed environment should fix this issue.

Resources