【问题标题】:Unsupported URL Type "link:" while using NPM使用 NPM 时不支持的 URL 类型“链接:”
【发布时间】:2022-12-05 02:54:07
【问题描述】:

按照网上的一些指导,我编辑了我的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


    【解决方案1】:

    这是因为link在最新版本的 NPM 中已被替换为file。只需更新您的package.json

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

    【讨论】:

      猜你喜欢
      • 2020-12-28
      • 2021-11-12
      • 2020-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-09
      • 2018-04-23
      相关资源
      最近更新 更多