1

Hi I wanted to install a npm package called nasim-bot but i got an error and couldn't find a solution for it.

The command was:

npm install nasim-bot

and the error is:

> [email protected] install /home/ali/Desktop/mailBot/node_modules/unix-dgram 
> node-gyp rebuild
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:354:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-21-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/ali/Desktop/mailBot/node_modules/unix-dgram
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1
npm WARN [email protected] No repository field.
3
  • Try to add symlink node to nodejs Commented Jan 30, 2017 at 8:49
  • Like ln -s /usr/bin/nodejs /usr/sbin/node Commented Jan 30, 2017 at 8:49
  • tnx my solution is like the solution you told me. Commented Jan 30, 2017 at 10:24

3 Answers 3

10

The problem was from the node.js that i installed. install it with this commands:

sudo npm install -g n
sudo n latest
Sign up to request clarification or add additional context in comments.

Comments

1

After running command

sudo apt-get install aptitude

then

sudo aptitude install npm

solved my problem

Comments

-1

check your npm with this command

sudo npm-check

if an error then re-install npm.

if npm is fine, then there must be some dependencies that would be missing or outdated, mostly outdated cause issues with it.

npm install -g npm-check-updates

ncu -u

npm update

`

1 Comment

npm-check is not provided out of the box in ubuntu, one needs to install this package globally first

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.