How can I compile/install node.js on Ubuntu? It failed with an error about cxx compiler
.
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Is shmid returned by shmget() unique across proces
- Why doesn't php sleep work in the windows-subs
- how to get running process information in java?
- google-drive can't get push notifications
One-liner to install all needed dependencies(curl and git are not really needed, but are very useful and also needed if you install via nvm).
Last two dependencies are not always needed, but installing them is really usefull anyway and you probably need it later anyway.
To only install cxx compiler
If openssl is missing
If you find yourself getting this error on Mac OSX, you need to install XCode.
https://developer.apple.com/
For Node.js v6:
For Node.js v7:
Optional: install build tools To compile and install native addons from npm you may also need to install build tools:
After to get latest NPM packages, if you need:
Partial source here.
I needed to run
yum install gcc-c++
on Cent OS.If like me, you are attempting to install this on an AWS instance running Amazon Linux AMI (which looks to be a cut down version CentOS):
Install base tools:
yum groupinstall "Development Tools"
Now install openssl-devel:
yum install openssl-devel
Node should compile fine now.
There is a package for it on launchpad.
https://launchpad.net/~chris-lea/+archive/node.js/