已开始接收错误;Could not resolve hostname github.com: Name or service not known
在将我们的npm版本从6.14.14
更新为8.1.2
之后,当尝试针对我们的private软件包运行npm publish
到我们的private注册表时。
我们的package.json
配置有"private": true
,并且我们还在构建服务器上的本地.npmrc
文件中配置了我们的私有注册表。
> npm publish dist/{{project}}
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/dist/{{project}}.git
npm ERR! ssh: Could not resolve hostname github.com: Name or service not known
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
为什么这个更新版本的npm要发布到github.com?
将构建代理目标切换回6.14.14
安装不会尝试发布到github.com,并成功地将其发布到我们的私有注册表。
1条答案
按热度按时间lyr7nygr1#
在迁移到节点16和npm 8后,我遇到了这个问题:
对于this issue,发布路径需要一个尾部斜杠。
所以
npm publish dist/myProject
应该是npm publish dist/myProject/