Friday, 10 March 2017

Install NodeJs

$ sudo node install
> 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
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
/usr/bin/env: node: No such file or directory
sudo ln -s /usr/bin/nodejs /usr/bin/node
grunt install
grunt: command not found

npm install grunt-cli -g


No comments:

Post a Comment