npm

npm

使用–verbose参数

使用这个什么npm命令时,后面加个**–verbose**参数,不然每次都看不出来,命令到底又没有在运行~

https://registry.npmjs.org/xxxxx attempt 1 failed with ECONNREFUSED

报这种错误:npm http fetch GET https://registry.npmjs.org/xxxxx attempt 1 failed with ECONNREFUSED

先查看代理

1
2
$ npm config get https-proxy
http://127.0.0.1:8080

查看本地端口又没有对应服务

1
$ netstat -ano

清空代理

1
2
npm config delete https-proxy
npm config delete proxy
1
2
npm config get proxy
npm config get https-proxy

结果都返回null,说明清空了

到这里至少不报这种错误,想哭~

十分感谢下面的链接,现在要在搜索引擎里能找到一份解决方案太难了~

参考链接

npm http fetch GET https://registry.npmjs.org/picocolors attempt 1 failed with ETIMEDOUT

又报这种错误:npm http fetch GET https://registry.npmjs.org/picocolors attempt 1 failed with ETIMEDOUT

连接超时,解决方案切换镜像源,那个什么淘宝镜像源再也不用了,好像之前的一个链接失效了,网上的好多教程还是那个链接,害死人~

1
npm config set registry https://mirrors.cloud.tencent.com/npm/

又被AI给骗了,直接访问镜像就是报错的没问题~

完美解决,这个错误没了~

Error: EPERM: operation not permitted, mkdir‘xxxxxxxxxxxxxxxx‘

好像又是npm相关的问题,真烦啊~

权限问题,开始菜单找到nodejs,然后进入通过原文件位置进入到nodejs安装目录,找到nodejs文件夹,右键属性->安全->允许users完全控制~

评论有说通过管理员运行,可我右键只有个git bash here啊~

npm xxxx cache miss cache hit

咱也不懂npm xxxx cache miss cache hit,这到底是报错还是没报错啊~

反证网上就是一顿让你清楚缓存~

1
2
3
npm cache clean -f

npm list -g --depth 0 // 查看安装了哪些包,后面的参数就不懂了

又报错~

参考链接

照着参考链接内容,一顿操作,虽然报的错有点不一样,但好像成功了

1
2
npm install -g yarn
yarn add mitt