Friday 10 March 2017

Install NodeJs

1. 
$ sudo node install
Errors:
> node-gyp configure buildgyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gypgyp ERR! configure errorgyp ERR! stack Error: `gyp` failed with exit code: 1
The Reason: Some npm plugins need node-gyp to be installed.
$ npm install --global node-gyp
2. 
To update Node, you’ll need npm’s handy n module. Run this code to clear npm’s cache, install n, and install the latest stable version of Node:
$ npm cache clean -f
$ npm install -g n

To install the latest release,
$ n latest

Alternatively, you can run
$ n #.#.#
to get a specific Node version(upgrading or downgrading).
Error when run node script: Module version mismatch. Expected 48, got 47

Solution: reinstall node

1. Remove node_modules directory completely (rm -rf node_modules)
2. Please ensure that you don't use sudo
3. npm install

bower install
Error
/usr/bin/env: node: No such file or directory
Solution
sudo ln -s /usr/bin/nodejs /usr/bin/node
grunt install
Error
grunt: command not found

Solution
npm install grunt-cli -g

Reference:
https://docs.npmjs.com/misc/removing-npm

No comments:

Post a Comment