Skip a package when running `npm -g outdated`

753 Views Asked by At

I have a package that I manually updated in order to have multiple versions of the same tool running (as explained here).

Now, when I execute npm -g outdated, I am getting the following output:

$ npm -g outdate                         
npm notice 
npm notice New minor version of npm available! 7.18.1 -> 7.20.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.20.1
npm notice Run npm install -g [email protected] to update!
npm notice 
npm ERR! code ENOVERSIONS
npm ERR! No versions available for ask-cli-1

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/b/.npm/_logs/2021-07-24T13_02_50_529Z-debug.log

Here are the contents of the log, edited for brevity:

0 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', '-g', 'update' ]
1 info using [email protected]
2 info using [email protected]
...
9 timing config:load:file:/usr/local/lib/node_modules/ask-cli-1/.npmrc Completed in 0ms
...
33 silly fetch manifest ask-cli-1@*
34 http fetch GET 200 https://registry.npmjs.org/ask-cli-1 38ms (cache hit)
...
40 silly placeDep ROOT ask-cli-1@ OK for:  want: *
...
316 timing idealTree:node_modules/ask-cli-1 Completed in 0ms
...
1338 verbose stack ask-cli-1: No versions available for ask-cli-1
1338 verbose stack     at pickManifest (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:140:25)
1338 verbose stack     at module.exports (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:187:16)
1338 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:118:26
1338 verbose stack     at async Arborist.[nodeFromEdge] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:936:19)
1338 verbose stack     at async Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:882:11)
1338 verbose stack     at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:218:7)
1338 verbose stack     at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:134:5)
1338 verbose stack     at async Update.update (/usr/local/lib/node_modules/npm/lib/update.js:72:5)
1339 verbose cwd /usr/local/lib/node_modules/ask-cli-1
1340 verbose Darwin 20.5.0
1341 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "-g" "update"
1342 verbose node v16.4.1
1343 verbose npm  v7.18.1
1344 error code ENOVERSIONS
1345 error No versions available for ask-cli-1
1346 verbose exit 1

Is there a way to avoid npm looking for a version of ask-cli-1?

1

There are 1 best solutions below

0
On

You can't exclude a package with npm outdated.

But I recomemnd this package: check-outdated

In your case npm i -g check-outdated Then: check-outdated --ignore-packages ask-cli-1 --columns name,type,current,latest,changes