[英]“npm install <github url>” Downloading from NPM instead of GitHub
So I am trying to install a package from GitHub, but for some reason npm install
is pulling a different package (which has the same name) from NPM, instead of GitHub. 所以我试图从GitHub安装一个软件包,但是由于某种原因
npm install
从NPM而不是GitHub提取了一个不同的软件包(具有相同的名称)。
When I run npm install git+https://github.com/wojtekmaj/react-daterange-picker
, it for some reason installs the package https://github.com/onefinestay/react-daterange-picker
. 当我运行
npm install git+https://github.com/wojtekmaj/react-daterange-picker
,出于某种原因,它会安装软件包https://github.com/onefinestay/react-daterange-picker
。 This happens even if I manually insert the GitHub package url into my package.json
dependancies, and then run npm install
. 即使我将GitHub软件包的URL手动插入
package.json
依赖关系中,然后运行npm install
,也会发生这种情况。
I have even tried deleting all my cache, and even deleting /node_modules/
and package-lock.json
and reinstalling via the command rm -rf node_modules package-lock.json && npm install
. 我什至尝试删除所有缓存,甚至删除
/node_modules/
和package-lock.json
并通过命令rm -rf node_modules package-lock.json && npm install
。
Any ideas why npm install
is pulling from NPM instead of GitHub? 有什么想法为什么
npm install
是从NPM而不是GitHub中提取的?
If I understand you correctly you do rm -rf node_modules package-lock.json && npm install
before trying your command. 如果我对您的理解正确,则在尝试命令之前先进行
rm -rf node_modules package-lock.json && npm install
。 But this will install everything according to package.json
and recreate package-lock.json
. 但这将根据
package.json
安装所有内容,然后重新创建package-lock.json
。 So when you do your modified command it won't work. 因此,当您执行修改后的命令时,它将不起作用。
I think the best way is to: 我认为最好的方法是:
rm -rf package-lock.json node_modules
package.json
to use the correct git+https link package.json
以使用正确的git + https链接 npm install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.