根据网上的一些指导,我编辑了我的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",
}