【问题标题】:yarn install can't find package but npm install canyarn install 找不到包,但 npm install 可以
【发布时间】:2017-09-22 17:02:31
【问题描述】:

我正在使用 yarn 来管理我的 npm 包。如果我这样做npm install,一切正常。但是,如果我尝试执行yarn install,则会失败并出现以下错误:

info No lockfile found.
[1/4] Resolving packages...
error Couldn't find package "ag-grid" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

这是指向一个内部存储库。为什么这不起作用?

【问题讨论】:

    标签: npm npm-install yarnpkg


    【解决方案1】:

    在尝试了各种方法并浏览了太多的 Google 页面后,我想通了。

    问题是我在.npmrc 中设置了以下内容:

    registry=https://internal-repo.com/some-path
    

    虽然它需要一个斜杠:

    registry=https://internal-repo.com/some-path/
    

    【讨论】:

    • 这也是我在yarn config list 上的问题,我的存储库缺少尾部斜杠
    猜你喜欢
    • 2022-01-05
    • 2018-11-15
    • 1970-01-01
    • 2020-10-08
    • 2018-05-04
    • 2022-10-06
    • 2015-12-16
    • 2016-02-08
    • 2022-07-12
    相关资源
    最近更新 更多