0
点赞
收藏
分享

微信扫一扫

leetcode 219. 存在重复元素 II

雷亚荣 2024-11-06 阅读 22
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR!     https://www.npmjs.com/forgot
npm ERR! 
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR!     npm login

npm ERR! A complete log of this run can be found in: /usr/local/www/.npm/_logs/2024-10-28T10_39_48_122Z-debug-0.log

错误原因: 私有包需要用户权限

排查解决过程:

        1、确认.npmrc配置文件中设置的源地址不是私有库地址。

                npm config get registry

                设置为阿里源:npm config set registry https://registry.npmmirror.com

        2、查看日志(此方法解决)

                查看/usr/local/www/.npm/_logs/2024-10-28T10_39_48_122Z-debug-0.log 日志文件

                确认异常包具体报错原因,如果.npmrc文件中是公有库地址,异常报错为私有库地址,则说明有缓存。

                解决:删除node_modules和package-lock.json ,重新执行npm install

        

举报

相关推荐

0 条评论