npm windows install globally results in npm ERR! extraneous
I am new to grunt and npm. So I am trying some "cookbook-example" on the site 'http://tech.pro/tutorial/1190/package-managers-an-introductory-guide-for-the-uninitiated-front-end-developer#front_end_developers'. You should not have to look there now, but I thought it could be good to share the site. So far so good, til it comes to the global installing. (Ok, some errors I had to figure out, but now I have working npm).
When it comes to the point trying to install something globally I get stuck.
What I did so far for testing globally installing some package:
Created test-directory
grunttest
-
Inside that directory:
npm install -g jshint
Output I can see:
npm http GET https://registry.npmjs.org/jshint
npm http 304 https://registry.npmjs.org/jshint
...
npm http 304 https://registry.npmjs.org/string_decoder
C:\Program Files\nodejs\node_modules\npm\jshint -> C:\Program Files\nodejs\node_modules\npm\node_modules\jshinnt
[email protected] C:\Program Files\nodejs\node_modules\npm\node_modules\jshint
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
I just realize the 304, which should be ok, due to just says the resource was not modified since last installation (few minutes before).
Checking if the jshint exists with:
`npm -global list`
Output:
[email protected] C:\Program Files\nodejs\node_modules\npm
├── [email protected]
├── [email protected]
├─...
├──
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected] extraneous
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │ └─... ├── [email protected]
├── [email protected]
└── [email protected]
**npm ERR! extraneous: [email protected] C:\Program Files\nodejs\node_modules\npm\node_modules\jshint npm**
Questions:
- Why do I get npm ERR! extraneous ...?
- What does it mean?
- How can I resolve this issue?
Information:
I am on a windows-machine Windows 7, using cygwin as shell.
trying to just the jshint (jshint someTestfile.js
) of course does not work.
Thanks in advance, Meru
npm ERR! extraneous
means a package is installed but is not listed in your project's package.json
.
Since you're listing packages that have been installed globally, it's going to give you a lot of extraneous errors that can be simply ignored because most things installed globally will not be in your project's package.json
.
1 & 2: It means you don't have the jshint listed in your project's package.json file but that it is globally installed. So it is not a big problem.
3: To avoid this extraneous error, you can run or re-run the install with the option --save
. This will update automatically you package.json file :
npm install -g jshint --save
Or need to update manually your package.json file with a "dependencies": {...}
I resolved this by doing an npm update
in the parent package's folder which removed some of the extraneous packages from the list and then did npm uninstall <package>
for the remaining few.
Seems to have worked, as I'm getting no errors after doing this.