I want to install gulp globally,so I use this command ,
npm install gulp -g
then throw this error:
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "E:\\nodejs\\node.exe" "E:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "gulp"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! path E:\nodejs\node_global\gulp
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR! syscall open
npm ERR! eisdir EISDIR: illegal operation on a directory, open 'E:\nodejs\node_global\gulp'
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.
npm ERR! Please include the following file with any support request:
npm ERR! H:\npm-debug.log
It seems that the error occurs because when it wants to open an director ,in fact it was an file.I checked for the node_global director and found an file named gulp.cmd and a file named gulp too.So there may be conflict between them.
It is an simple problem.I set the config of npm with this
cache=E:\nodejs\node_global
prefix=E:\nodejs\node_global
The cache and prefix should not be placed in same director.May be I just change it by accident.Happy coding:)
Related
I try to install Cordova on my system but got these errors:
What can I do to solve this?
C:\Users\madt>npm install -g cordova
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\madt\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova"
npm ERR! node v7.1.0
npm ERR! npm v3.10.9
npm ERR! file C:\Users\madt\AppData\Roaming\npm-cache\isarray\1.0.0\package\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token '\u0000' at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: C:\Users\madt\AppData\Roaming\npm-cache\isarray\1.0.0\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\madt\npm-debug.log
C:\Users\madt>
Never had such a problem before.
npm has a local cache for modules which you have installed, so maybe something stuck with modules. Try:
npm cache clean
It will delete data out of the cache folder.
I got this error when trying to install the ghost blogging software.
npm ERR! install Couldn't read dependencies
npm ERR! Darwin 15.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "--production"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path /Users/abe/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -2
npm ERR! package.json ENOENT, open '/Users/abe/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! Please include the following file with any support request:
I added this dependency to my package.json :
"user": "file:./server/models/user"
Inside my user file I've got module.exports = function() {...}
npm ERR! addLocal Could not install /home/WebstormProjects/project/server/models/user
npm ERR! Linux 3.19.0-30-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! path /home/WebstormProjects/project/server/models/user
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/WebstormProjects/project/server/models/user'
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/WebstormProjects/project/npm-debug.log
I did follow the doc : https://docs.npmjs.com/files/package.json#local-paths
The error messages aren't very helpful, but it has to be (emphasis mine):
a path to a local directory that contains a package
https://docs.npmjs.com/files/package.json#local-paths
You appear to be pointing it to a file. You probably need something like:
"user": "file:./server/models"
A package also requires a package.json, so in that case you'd need to have server/models/package.json.
I followed this guide to install node to my machine without having admin rights.
I put node.exe, (npm.cmd and node_modules ) both from the npm zip in C:\Users\rakibler\Node. I added that to my path. I ran npm install -g bower and got
npm ERR! Error: EISDIR, open 'C:\Users\rakibler\Node\bower'
npm ERR! at Error (native)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Users\\rakibler\\Node\\\\node.exe" "C:\\Users\\rakibler\\Node\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\Users\rakibler
npm ERR! node -v v0.12.7
npm ERR! npm -v 1.4.9
npm ERR! path C:\Users\rakibler\Node\bower
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\rakibler\npm-debug.log
npm ERR! not ok code 0
at the end. It also seems like something else is wrong, because everything it downloads goes to C:\Users\rakibler\Node instead of C:\Users\rakibler\Node\node_modules. Not sure what's going wrong here. Any idea?
i think you need to install the npm globlally using
"npm install -g npm"
and then use it in directory to install bower . i hope this will solve your issue
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.