Reputation: 171
I install node.js since I heard that we should prefer apt-get installation to native installation from source since it is easy to update or remove. Is it true?
What's the right way to determine the correct gcc version to develop node.js C++ addon if we install node.js using apt-get?
I installed the node.js using apt-get (PPA: https://launchpad.net/~chris-lea/+archive/node.js/+packages) on Ubuntu 12.04. For the C++ development, the gcc(g++) version of node.js and add-on should match to make sure the C++ symbols consistent, right?
Thanks.
Upvotes: 0
Views: 967
Reputation: 82
Use nvm to install from source:
nvm install [-s] <version>
and Node.js source code will be placed in '$NVM_DIR/src'.
Then use node-gyp to configure the environment and build your addon.
cd /path/to/your/node/addon/binding.gyp/file/
node-gyp configure
node-gyp build
It is practical, you don't need root permissions and will be compiled in the same environment.
Upvotes: 1