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

cannot update npm completely #168

Closed
HonoluluHenk opened this issue Jul 3, 2020 · 2 comments · Fixed by #212
Closed

cannot update npm completely #168

HonoluluHenk opened this issue Jul 3, 2020 · 2 comments · Fixed by #212

Comments

@HonoluluHenk
Copy link

MacOS catalina, fresh install of asdf-vm (bot git and homebrew) and nodejs plugin.
❯ asdf --version
v0.7.8-4a3e3d6
Nodejs plugin:
cd8dc32 (HEAD -> master, origin/master, origin/HEAD) HEAD@{0}: clone: from https://github.com/asdf-vm/asdf-nodejs.git

Steps to reproduce:

asdf install nodejs 12.13.1
asdf global nodejs 12.13.1
npm i -g npm

This currently seems to install npm@6.14.5
npm --version
6.14.5

but:
npx npm --version
still runs the old version: 6.12.1

What I noticed :

❯ ls -a ~/.asdf/installs/nodejs/12.13.1
.            ..           .npm         CHANGELOG.md LICENSE      README.md    bin          include      lib          share

There's a '.npm' directory.

Listing bin:

❯ ls -la ~/.asdf/installs/nodejs/12.13.1/bin
total 82616
drwxr-xr-x   5 foo  staff       160 19 Nov  2019 .
drwxr-xr-x  10 foo  staff       320  3 Jul 16:20 ..
-rwxr-xr-x   1 foo  staff  42297408 19 Nov  2019 node
lrwxr-xr-x   1 foo  staff        38 19 Nov  2019 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxr-xr-x   1 foo  staff        38 19 Nov  2019 npx -> ../lib/node_modules/npm/bin/npx-cli.js

Listing .npm/bin:

❯ ls -la ~/.asdf/installs/nodejs/12.13.1/.npm/bin
total 0
drwxr-xr-x  4 foo  staff  128  3 Jul 16:21 .
drwxr-xr-x  5 foo  staff  160  3 Jul 16:21 ..
lrwxr-xr-x  1 foo  staff   38  3 Jul 16:21 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxr-xr-x  1 foo  staff   38  3 Jul 16:21 npx -> ../lib/node_modules/npm/bin/npx-cli.js

So it seems there are two installations of npm:

❯ bin/npm --version
6.12.1
❯ .npm/bin/npm --version
6.14.5

I - and probably npx, too :) - was not expecting this for a global install.

FYI: after a fresh install of nodejs, the .npm/bin directory does not exist, only after the npm upgrade

Might be related to: #157

@augustobmoura
Copy link
Member

I think is related to #56, the commit 7b6df2d specifically, that overrides the npm binary by the one in .bin

I think trying both in the bin and .bin (in that order) should fix this. I will try something about it

@augustobmoura
Copy link
Member

@HonoluluHenk can you test the issue with the latest npm release? I could only reproduce with npm@6.x.x, I think it was a issue with the npx executable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants