【发布时间】:2020-03-27 20:34:53
【问题描述】:
所以我的 package.json 中有这样的依赖项
"my-package": "git+https://urlToMyPackage/my-package.git#my-branch"
如果你执行“npm install my-package”,就会发生这种情况。
npm ERR! Linux 5.0.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "my-package"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code E404
npm ERR! 404 Not found : my-package
npm ERR! 404
npm ERR! 404 'my-package' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! /home/user/workdir/npm-debug.log
如果我执行“npm install”,它将从我的 git repo 连同所有其他软件包一起安装。似乎当您安装单个软件包时,它不会首先检查您的 package.json 以查看它是否不是从 npm 注册表安装的。
从以前可以工作的 git 主机安装单个包。现在有不同的 npm 命令来执行此操作吗?
【问题讨论】: