1

I am running vagrant provision and the last step fails with "Error installing 'gulp'". See below.

What does it mean and how to resolve it? No one who ran this vagrant script ever had this issue before.

Stderr from the command:

stdin: is not a tty
[ERROR   ] Command 'npm install --silent --json --global "gulp"' failed with return code: 1
[ERROR   ] stdout: 
> v8flags@1.0.1 install /usr/local/lib/node_modules/gulp/node_modules/v8flags
> node fetch.js
[ERROR   ] stderr: sh: 1: node: not found
[ERROR   ] Error installing 'gulp': sh: 1: node: not found

I tried installing manually $ sudo npm install --json --global "gulp" but it gives me an error:

> v8flags@1.0.1 install /usr/local/lib/node_modules/gulp/node_modules/v8flags
> node fetch.js

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
OrangeDog
  • 36,653
  • 12
  • 122
  • 207
Vad
  • 3,658
  • 8
  • 46
  • 81
  • I found solution: http://stackoverflow.com/questions/21168141/can-not-install-packages-using-node-package-manager-in-ubuntu – Vad Oct 29 '14 at 21:14
  • Does this answer your question? [Cannot install packages using node package manager in Ubuntu](https://stackoverflow.com/questions/21168141/cannot-install-packages-using-node-package-manager-in-ubuntu) – OrangeDog Feb 17 '23 at 10:59

2 Answers2

0

npm is the package installer for Node.js, and your error message states that node could not be found.

  1. Is node installed as part of the setup?
  2. Is the path to node correctly set?
Anders Bornholm
  • 1,326
  • 7
  • 18
  • My error states npm cannot install gulp. When I tried to install gulp manually I got access error. It looks like this directory cannot be created: /usr/local/lib/node_modules/gulp/node_modules/v8flags – Vad Oct 29 '14 at 14:37
  • Sorry, misread the error. I think this is a file rights issue. I've had this happen when I've installed node using a package manager. A quick and dirty fix might be to use sudo when installing gulp globally. – Anders Bornholm Oct 29 '14 at 15:06
  • Thanks. I tried and the update is added to my question above. – Vad Oct 29 '14 at 15:27
0

The solution to my issue is to install this package directly on VM and rerun vagrant provision:

sudo apt-get install nodejs-legacy

This is the reference that helped me: Cannot install packages using node package manager in Ubuntu

Community
  • 1
  • 1
Vad
  • 3,658
  • 8
  • 46
  • 81