Opened 3 years ago

Last modified 12 months ago

#63119 new defect

npm7: global update refuses to update installed modules

Reported by: ShadSterling (Shad Sterling) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: ci42, cooljeanius (Eric Gallager)
Port: npm7

Description

I have a couple of global modules which are outdated; npm -g outdated gives

Package      Current   Wanted   Latest  Location                  Depended by
@types/node  15.12.2  15.12.4  15.12.4  node_modules/@types/node  global
typescript     4.3.2    4.3.4    4.3.4  node_modules/typescript   global

So I want to update those modules, but npm -g update refuses to do so, giving

npm ERR! update Ignoring attempt to update npm in /Users/polyergic/.npm-global/lib
npm ERR! update which is part of the MacPorts npm7 base
npm ERR! update installation. To update npm please run:
npm ERR! update sudo port selfupdate && sudo port upgrade npm7
npm ERR! Ignoring attempt to update npm in /Users/polyergic/.npm-global/lib which is part of the MacPorts npm7 base installation.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/polyergic/.npm/_logs/2021-06-19T15_10_56_465Z-debug.log

The documentation for npm update (https://docs.npmjs.com/cli/v7/commands/npm-update) says "If no package name is specified, all packages in the specified location (global or local) will be updated." I specified global without specifying a package, but none of the outdated global packages were updated.

Change History (3)

comment:1 Changed 3 years ago by blair (Blair Zajac)

Were those the only packages that needed updating? npm* has been patched to not allow updates to itself, but maybe that code is buggy.

comment:2 Changed 3 years ago by ShadSterling (Shad Sterling)

Yes, `npm outdated` lists packages that need updating

The patch seems to be preventing updates to more than just npm itself; npm -g update should update the packages listed by npm -g outdated, which doesn't include npm

comment:3 Changed 12 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.