npm show --outdated 产生 E404 'is not in this registry' 错误

npm show --outdated produces a E404 'is not in this registry' error

我有一个不想发布的私人项目。使用 node v17.3.0 和 npm 8.3.0,我无法实现显示过时的依赖项:

$ npm show --outdated
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/MYPROJECT - Not found
npm ERR! 404
npm ERR! 404  'MYPROJECT@latest' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /path/to/2021-12-23T11_30_01_692Z-debug-0.log

我的package.json很普通。

{
  "name": "MYPROJECT",
  "version": "1.0.0",
  "private": true,
  "licence": "UNLINCENSED",
  "devDependencies": {...},
  "dependencies": {...}
}

我错过了什么?

npm shownpm view. This command expects a package as an argument and searches it in the NPM registry. Here's what it outputs when I run npm view eslint (coloured 的别名):

eslint@8.6.0 | MIT | deps: 38 | versions: 294
An AST-based pattern checker for JavaScript.
https://eslint.org

keywords: ast, lint, javascript, ecmascript, espree

bin: eslint

dist
.tarball: https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz
.shasum: 4318c6a31c5584838c1a2e940c478190f58d558e
.integrity: sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==
.unpackedSize: 2.7 MB

dependencies:
@eslint/eslintrc: ^1.0.5            debug: ^4.3.2                       eslint-utils: ^3.0.0                fast-deep-equal: ^3.1.3             ignore: ^4.0.6
@humanwhocodes/config-array: ^0.9.2 doctrine: ^3.0.0                    eslint-visitor-keys: ^3.1.0         file-entry-cache: ^6.0.1            import-fresh: ^3.0.0
ajv: ^6.10.0                        enquirer: ^2.3.5                    espree: ^9.3.0                      functional-red-black-tree: ^1.0.1   imurmurhash: ^0.1.4
chalk: ^4.0.0                       escape-string-regexp: ^4.0.0        esquery: ^1.4.0                     glob-parent: ^6.0.1                 is-glob: ^4.0.0
cross-spawn: ^7.0.2                 eslint-scope: ^7.1.0                esutils: ^2.0.2                     globals: ^13.6.0
(...and 14 more.)

maintainers:
- openjsfoundation <npm@openjsf.org>
- eslintbot <nicholas+eslint@nczconsulting.com>
- nzakas <nicholas@nczconsulting.com>
- ivolodin <ivolodin@gmail.com>

dist-tags:
es6jsx: 0.11.0-alpha.0  latest: 8.6.0           next: 8.0.0-rc.0

published a week ago by eslintbot <nicholas+eslint@nczconsulting.com>

如果给出none,则搜索当前的那个。您的未发布,因此出现错误。

npm outdated 是查找过期依赖项的正确方法。这将输出:

Package                                    Current    Wanted  Latest  Location                                                Depended by
@types/chai                                 4.2.22     4.3.0   4.3.0  node_modules/@types/chai                                MYPROJECT
@types/jquery                                3.5.6    3.5.12  3.5.12  node_modules/@types/jquery                              MYPROJECT
@types/node                                16.10.3  16.11.19  17.0.8  node_modules/@types/node                                MYPROJECT
@typescript-eslint/eslint-plugin             5.0.0     5.9.1   5.9.1  node_modules/@typescript-eslint/eslint-plugin           MYPROJECT
@typescript-eslint/parser                    5.0.0     5.9.1   5.9.1  node_modules/@typescript-eslint/parser                  MYPROJECT
eslint                                       8.0.0     8.6.0   8.6.0  node_modules/eslint                                     MYPROJECT
mocha                                        9.1.2     9.1.3   9.1.3  node_modules/mocha                                      MYPROJECT
ts-node                                     10.3.0    10.4.0  10.4.0  node_modules/ts-node                                    MYPROJECT
typescript                                   4.4.3     4.5.4   4.5.4  node_modules/typescript                                 MYPROJECT
uglify-js                                   3.14.2    3.14.5  3.14.5  node_modules/uglify-js                                  MYPROJECT