问题
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!
回答1:
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
来源:https://stackoverflow.com/questions/42918425/why-cant-my-aws-instance-install-node-sass-pacakage