Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install npm #536

Closed
mpallante opened this issue Nov 8, 2018 · 6 comments
Closed

Unable to install npm #536

mpallante opened this issue Nov 8, 2018 · 6 comments
Assignees
Labels
docs Changes to README or other documentation

Comments

@mpallante
Copy link

mpallante commented Nov 8, 2018

Issue Template:

Describe issue including what OS you are using

I can no longer install npm.

I'm not sure it is a n related issue, but it came out to a collegue of mines who was using n on a new computer and tried to install node and npm using n.

I tried to update my installation and got the same problem.

I'm on MacOS HighSierra (10.12.6), but the collegue has a brand new computer with MacOS Mojave.

Describe what version of N you have

We both use the latest: 2.1.12

Describe how you installed N

curl -L https://git.io/n-install | bash -s -- -y 6.14.4 8.12.0

I installed some time ago, when node 8.12.0 was the lts, I had no issue and was able to install npm by running

curl -0 -L https://npmjs.com/install.sh | sh

on both 6.14.4 and 8.12.0

Steps to reproduce issue 1.2.3

My collegue followed this procedure

  1. curl -L https://git.io/n-install | bash -s -- -y 6.14.4 8.12.0
  2. curl -0 -L https://npmjs.com/install.sh | sh

but the second one failed.

Describe the results you received

We both got the same error

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  5450  100  5450    0     0   9023      0 --:--:-- --:--:-- --:--:--  473k
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
install npm@latest
fetching: https://registry.npmjs.org/npm/-/npm-6.4.1.tgz
up to date in 0.033s
sh: rimraf: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! npm@6.4.1 prepare: `node bin/npm-cli.js --no-audit --no-timing prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the npm@6.4.1 prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marco/.npm/_logs/2018-11-08T10_57_06_899Z-debug.log
npm ERR! code E404
npm ERR! 404 Not Found: 1.323s@latest

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/marco/.npm/_logs/2018-11-08T10_57_08_550Z-debug.log
It failed

Describe the results you expected

I expect npm to be installed

What version of npm you are using

My collegue is not able to install npm. I have a different outcome, probably because I was able to install it in the past.

$ n 10.13.0
$ curl -0 -L https://npmjs.com/install.sh | sh
... error as before ...
$ npm --version
-bash: /Users/marco/n/bin/npm: No such file or directory
... wtf, but...
$ n 6.14.4
$ npm --version
3.10.10
$ n 8.12.0
$ npm --version
6.4.1
... and surprise ...
$ n 10.13.0
$ npm --version
6.4.1

At this point, I'm completely confused

Additional information you deem important (e.g. issue happens only occasionally):

@shadowspawn
Copy link
Collaborator

shadowspawn commented Nov 9, 2018

I was able to reproduce the error, but I am not sure it is worth chasing what is going wrong in https://npmjs.com/install.sh. Since n installs node AND the included npm, you don't need to download another shell script to install npm. You already have npm, or you can use npm to install npm...

$ curl -L https://git.io/n-install | bash -s -- -y 6.14.4 8.12.0
$ . ~/.bash_profile # to update PATH
$ npm --version
3.10.10
$ npm install -g npm@latest
$ npm --version
6.4.1

You can see the version of npm included with node here

@mpallante
Copy link
Author

Ok, thank you for your feedback. I ran the npm install script because I saw this paragraph
https://github.com/tj/n#working-with-npm and (blindly, I admit) followed the procedure.

I'll report to my collegue to see if he is able to work with npm again.

@shadowspawn
Copy link
Collaborator

Good context, thanks. I was wondering why you were doing the command line npm install, and see why now.

Those working-with-npm instructions were only intended for recovering from broken npm, and n has been improved since then so fix-up hopefully no longer needed.

However, your experience suggests the instructions don't actually work on Mac! I'll try digging a bit more to see how README should change.

@shadowspawn
Copy link
Collaborator

I think this might be an issue with the npm install rather than with n, and have opened a bug on npm community.

https://npm.community/t/install-sh-fails-with-rimraf-command-not-found/3270

@shadowspawn
Copy link
Collaborator

Given the npm install script is not working on Mac, and an issue causing npm to break has been fixed in #470, planning to remove the suggestion from the README.

@shadowspawn shadowspawn added the docs Changes to README or other documentation label Mar 23, 2019
@shadowspawn shadowspawn self-assigned this Mar 23, 2019
@shadowspawn
Copy link
Collaborator

I have removed the instructions from the README in v3.0.1, since they do not work on Mac, and probably not needed anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Changes to README or other documentation
Projects
None yet
Development

No branches or pull requests

2 participants