【问题标题】:NPM not installing latest version of packageNPM 未安装最新版本的软件包
【发布时间】:2021-06-13 14:06:48
【问题描述】:

重现步骤:

npm init
npm i react-syntax-highlighter
{
  "dependencies": {
    "react-syntax-highlighter": "^15.4.3"
  }
}

我有最新版本,hourra!


npm init
npm i @storybook/components
npm i react-syntax-highlighter
{
  "dependencies": {
    "@storybook/components": "^6.2.9",
    "react-syntax-highlighter": "^13.5.3"
  }
}

什么?我花了 2 小时和很多 luck 才发现我没有最新的 react-syntax-highlighter 包,似乎是因为 @storybook/components 使用 react-syntax-highlighter@13.5.3

我发现 npm i <package_name> 并不总是安装最新版本完全不直观。为什么 NPM 是这样设计的?当我做npm i <package_name> 时,如何配置 NPM 以始终下载最新版本。基本上使@latest 成为默认行为(我认为这是默认行为)。

【问题讨论】:

    标签: npm npm-install


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-29
    相关资源
    最近更新 更多