首页 > 解决方案 > 使用链接包的项目上的 npm 过时/更新失败

问题描述

我遇到了在使用链接包的项目上运行npm outdated/失败的情况:npm update

$ npm outdated
npm ERR! code ETARGET
npm ERR! notarget No matching version found for my-library@^2.0.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myuser/.npm/_logs/2021-09-26T06_18_14_326Z-debug.log

这是链接的输出:

$ npm link my-library
/home/myuser/path/to/project/node_modules/my-library -> /home/myuser/path/to/node/node-v14.15.1-linux-x64/lib/node_modules/my-library -> /home/myuser/path/to/library/my-library

我清除了 npm 的缓存(强制)。删除了我的package-lock.jsonnode_modules。首先链接,然后npm install是其他依赖项。

没有任何方法可以解决这个问题。

$ npm -v
6.14.15
$ node -v
v14.15.1

标签: node.jsnpmnpm-link

解决方案


推荐阅读