Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Installing npm fails with ENOENT on npm.js #1004

Closed
tifroz opened this Issue · 5 comments

2 participants

@tifroz

Bit the bullet and tried to upgrade to npm 1.x...it fails with ENOENT on npm.js - I have npm 1.0 installed, could it be the reason why? I tried npm clean cache + reinstall as suggested on other threads, but no avail


HugoPro:npm hugo$ curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
101 3874 101 3874 0 0 13036 0 --:--:-- --:--:-- --:--:-- 25155
fetching: http://registry.npmjs.org/npm/-/npm-1.0.9-1.tgz
0.4.7
1.0.9-1
prefix=/Users/hugo/.nvm/v0.4.7

This script will find and eliminate any shims, symbolic
links, and other cruft that was installed by npm 0.x.

Is this OK? enter 'yes' or 'no'
yes

All clean!
! [ -d .git ] || git submodule update --init
node cli.js cache clean
node cli.js rm npm -g -f --loglevel error
node cli.js install -g -f
npm ERR! error installing npm@1.0.9-1 Error: ENOENT, No such file or directory '/Users/hugo/.nvm/v0.4.7/lib/node_modules/npm/bin/npm.js'
npm ERR! Error: ENOENT, No such file or directory '/Users/hugo/.nvm/v0.4.7/lib/node_modules/npm/bin/npm.js'
npm ERR! Report this entire log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com
npm ERR!
npm ERR! System Darwin 10.7.0
npm ERR! command "node" "/private/var/folders/31/31HZr49QF2OtWqgVT9wgfk+++TM/-Tmp-/npm.8028/package/cli.js" "install" "-g" "-f"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/31/31HZr49QF2OtWqgVT9wgfk+++TM/-Tmp-/npm.8028/package/npm-debug.log
npm not ok
make: *** [install] Error 2
npm WARN Not installed in /Users/hugo/.nvm/v0.4.7/lib/node_modules npm
npm ERR! error installing npm@1.0.9-1 Error: ENOENT, No such file or directory '/Users/hugo/.nvm/v0.4.7/lib/node_modules/npm/bin/npm.js'
npm ERR! Error: ENOENT, No such file or directory '/Users/hugo/.nvm/v0.4.7/lib/node_modules/npm/bin/npm.js'
npm ERR! Report this entire log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com
npm ERR!
npm ERR! System Darwin 10.7.0
npm ERR! command "/Users/hugo/.nvm/v0.4.7/bin/node" "/private/var/folders/31/31HZr49QF2OtWqgVT9wgfk+++TM/-Tmp-/npm.8028/package/cli.js" "install" "." "--force" "--global"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/31/31HZr49QF2OtWqgVT9wgfk+++TM/-Tmp-/npm.8028/package/npm-debug.log
npm not ok
It failed

@tifroz

I was able to install v1.0.6 without a glitch, but all the versions > 1.0.6 I tried to install failed with the same error

@takeru

metoo...

takeru@ssktkr:~$ nvm install v0.4.7

...
...

* installing build/default/node as /home/takeru/.nvm/v0.4.7/bin/node
* installing build/default/src/node_config.h as /home/takeru/.nvm/v0.4.7/include/node/node_config.h
Waf: Leaving directory `/home/takeru/.nvm/src/node-v0.4.7/build'
'install' finished successfully (0.142s)
Now using node v0.4.7
Installing npm...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3874  100  3874    0     0   4752      0 --:--:-- --:--:-- --:--:-- 22523
fetching: http://registry.npmjs.org/npm/-/npm-1.0.9-1.tgz
0.4.7
1.0.9-1
prefix=/home/takeru/.nvm/v0.4.7

This script will find and eliminate any shims, symbolic
links, and other cruft that was installed by npm 0.x.


All clean!
! [ -d .git ] || git submodule update --init
node cli.js cache clean
node cli.js rm npm -g -f --loglevel error
node cli.js install -g -f
npm ERR! Error: EPERM, Operation not permitted '/home/takeru/.npm/npm/1.0.9-1/package.json'
npm ERR! 
npm ERR! Please use 'sudo' or log in as root to run this command.
npm ERR! 
npm ERR!     sudo npm "install" "-g" "-f"
npm ERR! 
npm ERR! or set the 'unsafe-perm' config var to true.
npm ERR! 
npm ERR!     npm config set unsafe-perm true
npm ERR! 
npm ERR! System Linux 2.6.26-2-vserver-amd64
npm ERR! command "node" "/tmp/npm.6012/package/cli.js" "install" "-g" "-f"
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /tmp/npm.6012/package/npm-debug.log
npm not ok
make: *** [install] エラー 1
npm WARN Not installed in /home/takeru/.nvm/v0.4.7/lib/node_modules npm
npm ERR! Error: EPERM, Operation not permitted '/home/takeru/.npm/npm/1.0.9-1/package.json'
npm ERR! 
npm ERR! Please use 'sudo' or log in as root to run this command.
npm ERR! 
npm ERR!     sudo npm "install" "." "--force" "--global"
npm ERR! 
npm ERR! or set the 'unsafe-perm' config var to true.
npm ERR! 
npm ERR!     npm config set unsafe-perm true
npm ERR! 
npm ERR! System Linux 2.6.26-2-vserver-amd64
npm ERR! command "/home/takeru/.nvm/v0.4.7/bin/node" "/tmp/npm.6012/package/cli.js" "install" "." "--force" "--global"
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /tmp/npm.6012/package/npm-debug.log
npm not ok
It failed
takeru@ssktkr:~$ 


@takeru

rm -rf ~/.npm ~/.nvm
and retried.

* installing build/default/src/node_config.h as /home/takeru/.nvm/v0.4.8/include/node/node_config.h
Waf: Leaving directory `/home/takeru/.nvm/src/node-v0.4.8/build'
'install' finished successfully (0.144s)
Now using node v0.4.8
Installing npm...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3874  100  3874    0     0   6419      0 --:--:-- --:--:-- --:--:-- 26353
fetching: http://registry.npmjs.org/npm/-/npm-1.0.9-1.tgz
0.4.8
1.0.9-1
prefix=/home/takeru/.nvm/v0.4.8

This script will find and eliminate any shims, symbolic
links, and other cruft that was installed by npm 0.x.


All clean!
! [ -d .git ] || git submodule update --init
node cli.js cache clean
node cli.js rm npm -g -f --loglevel error
node cli.js install -g -f
/home/takeru/.nvm/v0.4.8/bin/npm -> /home/takeru/.nvm/v0.4.8/lib/node_modules/npm/bin/npm.js
npm@1.0.9-1 /home/takeru/.nvm/v0.4.8/lib/node_modules/npm 
It worked
takeru@ssktkr:~$ 

works well. :)

@tifroz

Thanks @takeru but I think we're having different set of issues. My problem isn't with permissions, it's that the script fails to find the npm.js file

@tifroz

As it turns out it's not a very good idea to have "bin" listed in the ~/.gitignore file (it will exclude the npm/bin from the install package)

I hadn't touched my ~/.gitignore in the last 2 years maybe - turns out it was full of rather dumb stuffs. Spring cleaning ~/.gitignore took care of the problem. Mission accomplished, npm v1.0.9-1 is now successfully installed (phew)

@tifroz tifroz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.