【发布时间】:2022-08-20 18:07:12
【问题描述】:
我跑了
npm i @wtw/canvas
并得到这个错误:
npm ERR! code E401
npm ERR! Unable to authenticate, need: Basic realm=\"https://pkgsprodsu3weu.app.pkgs.visualstudio.com/\"
我的 .npmrc:
@willistowerswatson:registry=https://rcss-willistowerswatson.pkgs.visualstudio.com/_packaging/Core@Local/npm/registry/
registry=https://registry.npmjs.org/
//always-auth=true
//pkgs.dev.azure.com/rcss-willistowerswatson/RadarEnterprise/_packaging/RadarEnterprise/npm/registry/:username=VssSessionToken
我已经尝试过:
vsts-npm-auth -config C:\\Users\\wilso224\\.npmrc
vsts-npm-auth v0.41.0.0
-----------------------
Already have credentials for https://rcss-willistowerswatson.pkgs.visualstudio.com/_packaging/Core@Local/npm/registry/
这也失败了:
npm i --registry https://registry.npmjs.org @wtw/canvas
结果:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@wtw%2fcanvas - Not found
npm ERR! 404
npm ERR! 404 \'@wtw/canvas@0.1.1\' is not in the npm registry.
我已经阅读了以下内容:
npm ERR! Unable to authenticate, need: Basic realm=\"Artifactory Realm\"
https://developercommunity.visualstudio.com/t/401-when-attempting-to-run-npm-install/928369
谢谢。
编辑#1 无论如何,我尝试了 npm login,它要求我设置一个新帐户等。我从事这项工作已经 3 年多,我不记得每次遇到此类错误时都需要设置一个帐户。
-
你试过
npm login -
我得到了 npm 错误! 404 未找到 - 获取 registry.npmjs.org/@wtw%2fcanvas - 未找到
-
你需要重置你的 npm 配置,最简单的方法是重新安装 nodejs(使用 nvm 应该超级容易)
-
我必须使用与团队其他成员相同的 nodejs 版本——nvm 会让我选择不同的版本
-
这个问题是与 Realm 直接相关还是只是一个 npm install/config 问题?