按照网上的一些指导,我编辑了我的内容package.json以包含一个linkURL:
...
"dependencies": {
...
"react": "link:../some-other-module/node_modules/react",
}
Run Code Online (Sandbox Code Playgroud)
但是在安装时,我收到以下错误:
$ npm install
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "link:": link:../some-other-module/node_modules/react
Run Code Online (Sandbox Code Playgroud)
phi*_*e_b 29
这是因为在最新版本的 NPM 中link已被替换。file只需更新您的package.json:
...
"dependencies": {
...
"react": "file:../some-other-module/node_modules/react",
}
Run Code Online (Sandbox Code Playgroud)