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

[BUG] Running 'npm update -g' does nothing, running 'npm -g update' works #745

Closed
johnkennedy9147 opened this issue Jan 30, 2020 · 1 comment

Comments

@johnkennedy9147
Copy link
Contributor

Attempting to update all globally installed packages.

npm outdated shows:

Package Current Wanted Latest Location
eslint 5.16.0 5.16.0 6.8.0 global
gatsby-cli 2.8.21 2.8.28 2.8.28 global
lighthouse 4.3.0 4.3.1 5.6.0 global
prettier 1.18.2 1.19.1 1.19.1 global
rimraf 2.6.3 2.7.1 3.0.1 global
yarn 1.15.2 1.21.1 1.21.1 global

Current Behavior

The example given in docs doesn't work
npm update -g
No action take by npm.
No console output shown

However, putting the global flag up front works.
npm -g update
globally installed packages successfully updated.

npm outdated now shows

Package Current Wanted Latest Location
eslint 5.16.0 5.16.0 6.8.0 global
lighthouse 4.3.1 4.3.1 5.6.0 global

npm list -g --depth=0
returns

+-- eslint@5.16.0
+-- gatsby-cli@2.8.28
+-- jasmine@3.5.0
+-- lighthouse@4.3.1
+-- npm@6.13.7
+-- openfin-cli@2.0.12
+-- prettier@1.19.1
`-- yarn@1.21.1

Failing command behaved same on V6.4.1 and V6.13.7

Successful command only tried on 6.13.7.

I'll raise a seperate bug report for versions not all having gone to latest.

@johnkennedy9147
Copy link
Contributor Author

Closing this as its seems to have been caused by some issue with the installation of rimraf.

I had other issues with rimraf, including:
I noticed rimraf wasn't showing up when running npm list -g --depth=0
I was getting command not found when trying to run it.

No idea what the underlying problem was or why calling the update command differently worked, probably was just coincidence I likely did something between the two runs that fixed it without realising.

Everything working as expected now.

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

No branches or pull requests

1 participant