使用 NPM 时不受支持的 URL 类型 "link:"



根据网上的一些指导,我编辑了我的package.json,包括link的URL:

...
"dependencies": {
...
"react": "link:../some-other-module/node_modules/react",
}

但是在安装时,我得到以下错误:

$ npm install
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "link:": link:../some-other-module/node_modules/react

这是因为在最近的NPM版本中link已经被file取代了。只需更新您的package.json:

...
"dependencies": {
...
"react": "file:../some-other-module/node_modules/react",
}

最新更新