npm 3.20, npm update error #9095

Closed
robertbaker opened this Issue Jul 29, 2015 · 16 comments

Projects

None yet

8 participants

@robertbaker

Seems to happen to cordova also.

$ npm uninstall gulp

# install Gulp 4 CLI tools globally from 4.0 GitHub branch
$ npm install gulpjs/gulp-cli#4.0 -g

# install Gulp 4 into your project
$ npm install gulpjs/gulp.git#4.0 --save-dev

When I run npm update I get this:

d:\git\layout>npm update && jspm update
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "update"
npm ERR! node v0.12.7
npm ERR! npm  v3.2.0
npm ERR! code ENOSELF

npm ERR! Refusing to install cordova-android as a dependency of itself
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     d:\git\layout\npm-debug.log

debug log
http://pastebin.com/raw.php?i=HBAMT69c

@othiym23 othiym23 added the bug label Jul 29, 2015
@othiym23 othiym23 added this to the 3.x milestone Jul 29, 2015
@robertbaker robertbaker changed the title from NPM 3.20, npm update with gulp 4. to NPM 3.20, npm update error Aug 4, 2015
@othiym23 othiym23 changed the title from NPM 3.20, npm update error to npm 3.20, npm update error Aug 5, 2015
@Fleischers

+1, I have the same for async package. Current npm version is 3.2.1

I seems that nconf use async v0.9, but my project rely on async v1.4.

@iarna iarna added the blocker label Aug 11, 2015
@iarna iarna modified the milestone: 3.x-next, 3.x Aug 17, 2015
@iarna iarna self-assigned this Aug 17, 2015
@iarna iarna added the in progress label Aug 17, 2015
@iarna iarna added a commit that referenced this issue Aug 20, 2015
@iarna iarna update: Fix path used to run the install relative to
Previously I was using the path of the module to be updated.  But no, silly,
we want the path that CONTAINS it.

PR-URL: #9303
Fixes: #9095
b9e57c9
@iarna iarna added a commit that referenced this issue Aug 21, 2015
@iarna iarna update: Fix path used to run the install relative to
Previously I was using the path of the module to be updated.  But no, silly,
we want the path that CONTAINS it.

PR-URL: #9303
Fixes: #9095
0d4ca0d
@iarna iarna added ready and removed in progress labels Aug 21, 2015
@iarna iarna added a commit that referenced this issue Aug 21, 2015
@iarna iarna update: Fix path used to run the install relative to
Previously I was using the path of the module to be updated.  But no, silly,
we want the path that CONTAINS it.

PR-URL: #9303
Fixes: #9095
f130a00
@othiym23
Contributor

Fixed via f130a00, which is included in npm@3.3.1. Thanks for identifying this issue, and for your patience while we addressed it!

@othiym23 othiym23 closed this Aug 28, 2015
@romeovs
romeovs commented Nov 19, 2015

I'm getting this error in npm@3.4. For example: npm i --save trine.

@robertbaker

@romeovs try 3.4.1

@romeovs
romeovs commented Nov 20, 2015

@robertbaker Same problem arises:

$ npm -v
3.4.1
$ npm i trine
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "trine"
npm ERR! node v5.0.0
npm ERR! npm  v3.4.1
npm ERR! code ENOSELF

npm ERR! Refusing to install trine as a dependency of itself
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/romeovs/web/examples/trine/npm-debug.log

The strange thing is that trine isn't even a dependency (according to its package.json) of trine.

These are the contents of npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'i', 'trine' ]
2 info using npm@3.4.1
3 info using node@v5.0.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData trine
8 silly fetchNamedPackageData trine
9 silly mapToRegistry name trine
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry uri https://registry.npmjs.org/trine
13 verbose request uri https://registry.npmjs.org/trine
14 verbose request no auth needed
15 info attempt registry request try #1 at 2:53:27 PM
16 verbose request id 042787ec2e79ae91
17 http request GET https://registry.npmjs.org/trine
18 http 200 https://registry.npmjs.org/trine
19 verbose headers { server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)',
19 verbose headers   etag: '"9K4CE70Q13XZ5GNZ0479OZQAZ"',
19 verbose headers   'content-type': 'application/json',
19 verbose headers   'cache-control': 'max-age=60',
19 verbose headers   'content-length': '11010',
19 verbose headers   'accept-ranges': 'bytes',
19 verbose headers   date: 'Fri, 20 Nov 2015 13:53:28 GMT',
19 verbose headers   via: '1.1 varnish',
19 verbose headers   age: '0',
19 verbose headers   connection: 'keep-alive',
19 verbose headers   'x-served-by': 'cache-ams4127-AMS',
19 verbose headers   'x-cache': 'HIT',
19 verbose headers   'x-cache-hits': '1',
19 verbose headers   'x-timer': 'S1448027608.062009,VS0,VE378',
19 verbose headers   vary: 'Accept' }
20 silly get cb [ 200,
20 silly get   { server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)',
20 silly get     etag: '"9K4CE70Q13XZ5GNZ0479OZQAZ"',
20 silly get     'content-type': 'application/json',
20 silly get     'cache-control': 'max-age=60',
20 silly get     'content-length': '11010',
20 silly get     'accept-ranges': 'bytes',
20 silly get     date: 'Fri, 20 Nov 2015 13:53:28 GMT',
20 silly get     via: '1.1 varnish',
20 silly get     age: '0',
20 silly get     connection: 'keep-alive',
20 silly get     'x-served-by': 'cache-ams4127-AMS',
20 silly get     'x-cache': 'HIT',
20 silly get     'x-cache-hits': '1',
20 silly get     'x-timer': 'S1448027608.062009,VS0,VE378',
20 silly get     vary: 'Accept' } ]
21 verbose get saving trine to /Users/romeovs/.npm/registry.npmjs.org/trine/.cache.json
22 verbose makeDirectory /Users/romeovs/.npm creation not in flight; initializing
23 silly makeDirectory /Users/romeovs/.npm uid: 501 gid: 20
24 silly install normalizeTree
25 silly loadCurrentTree Finishing
26 silly loadIdealTree Starting
27 silly install loadIdealTree
28 silly cloneCurrentTree Starting
29 silly install cloneCurrentTreeToIdealTree
30 silly cloneCurrentTree Finishing
31 silly loadShrinkwrap Starting
32 silly install loadShrinkwrap
33 silly loadShrinkwrap Finishing
34 silly loadAllDepsIntoIdealTree Starting
35 silly install loadAllDepsIntoIdealTree
36 silly rollbackFailedOptional Starting
37 silly rollbackFailedOptional Finishing
38 silly runTopLevelLifecycles Starting
39 silly runTopLevelLifecycles Finishing
40 silly install printInstalled
41 verbose stack Error: Refusing to install trine as a dependency of itself
41 verbose stack     at checkSelf (/usr/local/lib/node_modules/npm/lib/install/validate-args.js:40:14)
41 verbose stack     at Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
41 verbose stack     at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
41 verbose stack     at chain (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:20:5)
41 verbose stack     at /usr/local/lib/node_modules/npm/lib/install/validate-args.js:15:5
41 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
41 verbose stack     at Array.forEach (native)
41 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
41 verbose stack     at Array.forEach (native)
41 verbose stack     at asyncMap (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
42 verbose cwd /Users/romeovs/web/examples/trine
43 error Darwin 15.0.0
44 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "trine"
45 error node v5.0.0
46 error npm  v3.4.1
47 error code ENOSELF
48 error Refusing to install trine as a dependency of itself
49 error If you need help, you may report this error at:
49 error     <https://github.com/npm/npm/issues>
50 verbose exit [ 1, true ]
@robertbaker

@romeovs Try the new release of 3.5, which should fix these problems (according to them).

@MishaShapo

I also have the same issue while installing my own gulp plugin.

Mishas-Air-2:Grunt Testing michailshaposhnikov$ npm install phaser-asset-loader --save-dev
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "phaser-asset-loader" "--save-dev"
npm ERR! node v5.1.0
npm ERR! npm  v3.3.12
npm ERR! code ENOSELF

npm ERR! Refusing to install phaser-asset-loader as a dependency of itself
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/michailshaposhnikov/Documents/Web Dev Projects/Grunt Testing/npm-debug.log
Mishas-Air-2:Grunt Testing michailshaposhnikov$

npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   'phaser-asset-loader',
1 verbose cli   '--save-dev' ]
2 info using npm@3.3.12
3 info using node@v5.1.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData phaser-asset-loader@~0.1.0
8 silly fetchNamedPackageData phaser-asset-loader
9 silly mapToRegistry name phaser-asset-loader
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry uri https://registry.npmjs.org/phaser-asset-loader
13 verbose request uri https://registry.npmjs.org/phaser-asset-loader
14 verbose request no auth needed
15 info attempt registry request try #1 at 11:39:44 AM
16 verbose request using bearer token for auth
17 verbose request id e3a25b703b315992
18 verbose etag "BE0VAAW2HI5YASV7Q8NKRRB5L"
19 http request GET https://registry.npmjs.org/phaser-asset-loader
20 http 304 https://registry.npmjs.org/phaser-asset-loader
21 verbose headers { 'cache-control': 'max-age=60',
21 verbose headers   'accept-ranges': 'bytes',
21 verbose headers   date: 'Sat, 21 Nov 2015 17:39:45 GMT',
21 verbose headers   via: '1.1 varnish',
21 verbose headers   connection: 'keep-alive',
21 verbose headers   'x-served-by': 'cache-ord1726-ORD',
21 verbose headers   'x-cache': 'MISS',
21 verbose headers   'x-cache-hits': '0',
21 verbose headers   'x-timer': 'S1448127585.077611,VS0,VE63' }
22 silly get cb [ 304,
22 silly get   { 'cache-control': 'max-age=60',
22 silly get     'accept-ranges': 'bytes',
22 silly get     date: 'Sat, 21 Nov 2015 17:39:45 GMT',
22 silly get     via: '1.1 varnish',
22 silly get     connection: 'keep-alive',
22 silly get     'x-served-by': 'cache-ord1726-ORD',
22 silly get     'x-cache': 'MISS',
22 silly get     'x-cache-hits': '0',
22 silly get     'x-timer': 'S1448127585.077611,VS0,VE63' } ]
23 verbose etag https://registry.npmjs.org/phaser-asset-loader from cache
24 verbose get saving phaser-asset-loader to /Users/michailshaposhnikov/.npm/registry.npmjs.org/phaser-asset-loader/.cache.json
25 silly install normalizeTree
26 silly loadCurrentTree Finishing
27 silly loadIdealTree Starting
28 silly install loadIdealTree
29 silly cloneCurrentTree Starting
30 silly install cloneCurrentTreeToIdealTree
31 silly cloneCurrentTree Finishing
32 silly loadShrinkwrap Starting
33 silly install loadShrinkwrap
34 silly loadShrinkwrap Finishing
35 silly loadAllDepsIntoIdealTree Starting
36 silly install loadAllDepsIntoIdealTree
37 silly rollbackFailedOptional Starting
38 silly rollbackFailedOptional Finishing
39 silly runTopLevelLifecycles Starting
40 silly runTopLevelLifecycles Finishing
41 silly install printInstalled
42 verbose stack Error: Refusing to install phaser-asset-loader as a dependency of itself
42 verbose stack     at checkSelf (/usr/local/lib/node_modules/npm/lib/install/validate-args.js:40:14)
42 verbose stack     at Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
42 verbose stack     at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
42 verbose stack     at chain (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:20:5)
42 verbose stack     at /usr/local/lib/node_modules/npm/lib/install/validate-args.js:15:5
42 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
42 verbose stack     at Array.forEach (native)
42 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
42 verbose stack     at Array.forEach (native)
42 verbose stack     at asyncMap (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
43 verbose cwd /Users/michailshaposhnikov/Documents/Web Dev Projects/Grunt Testing
44 error Darwin 15.0.0
45 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "phaser-asset-loader" "--save-dev"
46 error node v5.1.0
47 error npm  v3.3.12
48 error code ENOSELF
49 error Refusing to install phaser-asset-loader as a dependency of itself
50 error If you need help, you may report this error at:
50 error     <https://github.com/npm/npm/issues>
51 verbose exit [ 1, true ]

@robertbaker

Both of you must update to npm 3.5.x to fix

On Sat, Nov 21, 2015, 10:43 AM Misha notifications@github.com wrote:

I also have the same issue while installing my own gulp plugin.

Mishas-Air-2:Grunt Testing michailshaposhnikov$ npm install phaser-asset-loader --save-dev
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "phaser-asset-loader" "--save-dev"
npm ERR! node v5.1.0
npm ERR! npm v3.3.12
npm ERR! code ENOSELF

npm ERR! Refusing to install phaser-asset-loader as a dependency of itself
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /Users/michailshaposhnikov/Documents/Web Dev Projects/Grunt Testing/npm-debug.log
Mishas-Air-2:Grunt Testing michailshaposhnikov$

npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli 'phaser-asset-loader',
1 verbose cli '--save-dev' ]
2 info using npm@3.3.12
3 info using node@v5.1.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData phaser-asset-loader@~0.1.0
8 silly fetchNamedPackageData phaser-asset-loader
9 silly mapToRegistry name phaser-asset-loader
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry uri https://registry.npmjs.org/phaser-asset-loader
13 verbose request uri https://registry.npmjs.org/phaser-asset-loader
14 verbose request no auth needed
15 info attempt registry request try #1 at 11:39:44 AM
16 verbose request using bearer token for auth
17 verbose request id e3a25b703b315992
18 verbose etag "BE0VAAW2HI5YASV7Q8NKRRB5L"
19 http request GET https://registry.npmjs.org/phaser-asset-loader
20 http 304 https://registry.npmjs.org/phaser-asset-loader
21 verbose headers { 'cache-control': 'max-age=60',
21 verbose headers 'accept-ranges': 'bytes',
21 verbose headers date: 'Sat, 21 Nov 2015 17:39:45 GMT',
21 verbose headers via: '1.1 varnish',
21 verbose headers connection: 'keep-alive',
21 verbose headers 'x-served-by': 'cache-ord1726-ORD',
21 verbose headers 'x-cache': 'MISS',
21 verbose headers 'x-cache-hits': '0',
21 verbose headers 'x-timer': 'S1448127585.077611,VS0,VE63' }
22 silly get cb [ 304,
22 silly get { 'cache-control': 'max-age=60',
22 silly get 'accept-ranges': 'bytes',
22 silly get date: 'Sat, 21 Nov 2015 17:39:45 GMT',
22 silly get via: '1.1 varnish',
22 silly get connection: 'keep-alive',
22 silly get 'x-served-by': 'cache-ord1726-ORD',
22 silly get 'x-cache': 'MISS',
22 silly get 'x-cache-hits': '0',
22 silly get 'x-timer': 'S1448127585.077611,VS0,VE63' } ]
23 verbose etag https://registry.npmjs.org/phaser-asset-loader from cache
24 verbose get saving phaser-asset-loader to /Users/michailshaposhnikov/.npm/registry.npmjs.org/phaser-asset-loader/.cache.json
25 silly install normalizeTree
26 silly loadCurrentTree Finishing
27 silly loadIdealTree Starting
28 silly install loadIdealTree
29 silly cloneCurrentTree Starting
30 silly install cloneCurrentTreeToIdealTree
31 silly cloneCurrentTree Finishing
32 silly loadShrinkwrap Starting
33 silly install loadShrinkwrap
34 silly loadShrinkwrap Finishing
35 silly loadAllDepsIntoIdealTree Starting
36 silly install loadAllDepsIntoIdealTree
37 silly rollbackFailedOptional Starting
38 silly rollbackFailedOptional Finishing
39 silly runTopLevelLifecycles Starting
40 silly runTopLevelLifecycles Finishing
41 silly install printInstalled
42 verbose stack Error: Refusing to install phaser-asset-loader as a dependency of itself
42 verbose stack at checkSelf (/usr/local/lib/node_modules/npm/lib/install/validate-args.js:40:14)
42 verbose stack at Array. (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
42 verbose stack at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
42 verbose stack at chain (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:20:5)
42 verbose stack at /usr/local/lib/node_modules/npm/lib/install/validate-args.js:15:5
42 verbose stack at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
42 verbose stack at Array.forEach (native)
42 verbose stack at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
42 verbose stack at Array.forEach (native)
42 verbose stack at asyncMap (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
43 verbose cwd /Users/michailshaposhnikov/Documents/Web Dev Projects/Grunt Testing
44 error Darwin 15.0.0
45 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "phaser-asset-loader" "--save-dev"
46 error node v5.1.0
47 error npm v3.3.12
48 error code ENOSELF
49 error Refusing to install phaser-asset-loader as a dependency of itself
50 error If you need help, you may report this error at:
50 error https://github.com/npm/npm/issues
51 verbose exit [ 1, true ]


Reply to this email directly or view it on GitHub
#9095 (comment).

@MishaShapo

I apologize for my simple question. But how can I upgrade to 3.5.x?

I've already done
node update -g

and

npm install -g n

Is there another command I am missing?

@KenanY
Member
KenanY commented Nov 21, 2015

@MishaShapo Maybe check this out?

@MishaShapo

@KenanY
Weird, I wrote
sudo npm install -g npm@latest

And yet, when I type

npm -v

I still get 3.4.1

EDIT:
Even on npm itself, it shows that the latest version of npm is 3.4.1

@KenanY
Member
KenanY commented Nov 21, 2015

@MishaShapo sudo npm install -g npm@3.5

@MishaShapo

@KenanY Yep, that command worked. Thank you. =)

@mofax
mofax commented May 14, 2016 edited

@iarna am getting this error with npm@3.8.6

npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "graphql"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6
npm ERR! code ENOSELF

npm ERR! Refusing to install graphql as a dependency of itself
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/alloys/Documents/graphql/npm-debug.log
@KenanY
Member
KenanY commented May 14, 2016

@mofax Unrelated issue. Try renaming this directory /home/alloys/Documents/graphql/ to something that is not the name of one of your dependencies.

@mofax
mofax commented May 14, 2016

@KenanY thanks!, renamed the directory and found out that actually the issue is the name field on my package.json. changed it from graphql to something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment