[英]npm show --outdated produces a E404 'is not in this registry' error
我有一個不想發布的私人項目。 使用節點 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 show
是npm view
的別名。 此命令需要 package 作為參數,並在 NPM 注冊表中搜索它。 這是我運行npm view eslint
(彩色)時輸出的內容:
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>
如果沒有給出,那么它會搜索當前的。 你的沒有發布,因此你得到的錯誤。
npm outdated
是查找過期依賴項的正確方法。 這將 output:
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.