我将从 node 14(带有NPM 6)切换到 node 16(带有NPM 8)以用于我的Angular 应用程序.
此应用程序有一个我们打包为NPM包的项目.
当在本地工作时,我们有一个脚本来构建这个项目(本地到dist/my-private-package-name
文件夹中),然后我们安装这个本地构建的pkg和npm install dist/my-private-package-name
.
在NPM 6上,我们不需要登录来安装这个本地pkg(啊,它是本地版本).
然而,当我try 在NPM 8中运行上面的安装命令(在VSCode中)时,它要求我登录到GitHub,这是愚蠢的,因为它是本地的.我甚至在GitHub上没有用户,因为我的公司不使用该用户,我们将我们的私有NPM包存储到私有repo中.
即使当我在终端中的VSCode外部运行该命令时,它仍然失败,并显示以下消息:
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/my-private-package-name.git
npm ERR! git@github.com: Permission denied (publickey).
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 ERR! A complete log of this run can be found in:
npm ERR! /Users/cn188854/.npm/_logs/2023-07-06T01_30_36_497Z-debug.log
Surely there has to be a way to install local builds in NPM 8, right?个
如果这很重要,我们的套餐是有范围的.