Error code -2 when installing gulp - node.js

I'm trying to install Gulp using Node.js on OSX but something goes wrong. Here's what i do.
I installed node.js
use sudo npm init to create package.json file
use sudo npm install —save-dev gulp
At this point there was the error.
npm WARN package.json dependencies#1.0.0 No description
npm WARN package.json dependencies#1.0.0 No repository field.
npm WARN package.json dependencies#1.0.0 No README data
npm ERR! addLocal Could not install /Users/dorinocanciani/Sites/prova/resources/dependencies/—save-dev
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "—save-dev" "gulp"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path /Users/dorinocanciani/Sites/prova/resources/dependencies/—save-dev
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! enoent ENOENT, open '/Users/dorinocanciani/Sites/prova/resources/dependencies/—save-dev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/dorinocanciani/Sites/prova/resources/dependencies/npm-debug.log
I searched a lot in google but with no results for this type of error.
Please can you help me to fix the error?

You missed a - in the command it should be: npm install --save-dev gulp
UPDATE: It seems like you are not using the - at all but this — that's another character and is wrong.

Related

npm throws ENOENT error when trying to install module

The documentation for the module tells me to run npm install --save mapbox-gl but when I try this I receive the following error.
npm ERR! addLocal Could not install
/Users/marchorne/conichi/cmc/node_modules/mapbox-gl/src/style-spec
npm WARN deprecated point-geometry#0.0.0: This module has moved: please
install #mapbox/point-geometry instead
npm WARN deprecated vector-tile#1.3.0: This module has moved: please
install #mapbox/vector-tile instead
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "mapbox-gl"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! path /Users/marchorne/conichi/cmc/node_modules/mapbox-gl/src/style-spec
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open
'/Users/marchorne/conichi/cmc/node_modules/mapbox-gl/src/style-spec'
npm ERR! enoent ENOENT: no such file or directory, open
'/Users/marchorne/conichi/cmc/node_modules/mapbox-gl/src/style-spec'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/marchorne/conichi/cmc/npm-debug.log
My system is MacOS Sierra 10.12.5
Node version: v6.10.0
NPM version: v3.10.10
v0.39 seems to be broken see https://github.com/mapbox/mapbox-gl-js/issues/5025
You can try to install previous version with npm install --save mapbox-gl#0.38.0

need help in installing bitcoincore?

i keep getting this error
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\eze samuel\package.json'
npm WARN eze samuel No description
npm WARN eze samuel No repository field.
npm WARN eze samuel No README data
npm WARN eze samuel No license field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bitcore"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! bitcore-node#3.1.3 preinstall: `./scripts/download`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bitcore-node#3.1.3 preinstall script './scripts/download'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bitcore-node package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./scripts/download
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bitcore-node
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bitcore-node
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\eze samuel\npm-debug.log
The bitcore library explicitly tells you to install globally:
Spin up a full node and join the network:
npm install -g bitcore
bitcored
Note the -g flag in the command. Currently, you're running npm install bitcore, which fails because you're trying to install locally without a package.json file. If you're not installing with -g, you must run npm init first before installing anything. In this case, you are installing with -g, so just follow the docs step by step, copying exactly what they tell you.

"npm not being able to find a file abbrev" when installing aurelia cli

I am installing aurelia-cli in my production version. I am following instruction from 'http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/the-aurelia-cli', now everytime when I am trying to run npm install aurelia-cli -g it gives me below error:
npm ERR! Linux 4.2.0-042stab113.11
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install" "aurelia-cli" "-g"
npm ERR! node v4.2.6
npm ERR! npm v4.0.3
npm ERR! path /usr/local/lib/node_modules/.staging/abbrev-d3948789
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-d3948789' -> '/usr/local/lib/node_modules/aurelia-cli/node_modules/npm/node_modules/abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-d3948789' -> '/usr/local/lib/node_modules/aurelia-cli/node_modules/npm/node_modules/abbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /etc/apt/npm-debug.log
I have no idea about that specific error, however, this often works for me, and this method of doing a fresh reinstall is often recommended on gitter by the aurelia folks:
npm uninstall -g aurelia-cli
npm clear cache
npm install -g aurelia-cli
rm -rf node_modules
npm install
npm install # on freebsd sometimes I have to run this more than once

NPM error when trying to install gulp and bower

I'm trying to install gulp and bower by running npm install --global gulp bower . Everything seems to be going fine then I get this:
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--global" "yo" "gulp" "bower"
npm ERR! node v4.2.2
npm ERR! npm v3.5.0
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/ordered-read-streams
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/ordered-read-streams' -> '/usr/local/lib/node_modules/gulp/node_modules/ordered-read-streams'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/ordered-read-streams' -> '/usr/local/lib/node_modules/gulp/node_modules/ordered-read-streams'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/deang/npm-debug.log
I've also tried running the command using sudo, but to no avail. Any pointers?
Update:
This seems to be happening for everything I'm trying to install. Just tried sudo npm install --global generator-gulp-webapp and it did the same thing.
are you using npm 3.x? if so, try downgrading to npm 2.x (you can npm install npm#2.14.12).
npm 3.x has a couple of issues with yeoman

npm install serialport not working

When I try installing serialport it gives the following warnings:
sudo npm install serialport --save
npm WARN EPACKAGEJSON arduino#1.0.0 No description
npm WARN EPACKAGEJSON arduino#1.0.0 No repository field.
npm ERR! Linux 3.13.0-61-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "serialport" "--save"
npm ERR! node v0.12.4
npm ERR! npm v3.3.8
npm ERR! path /home/ayushgp/learning/arduino/node_modules/serialport/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/bin/har-validator
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! enoent ENOENT, chmod '/home/ayushgp/learning/arduino/node_modules/serialport/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/bin/har-validator'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /home/ayushgp/learning/arduino/npm-debug.log
Take a look to this workaround (node version v4.2.4):
npm install serialport --build-from-source
As I have read in many forums, it is not a good practice to use sudo with npm.

Resources