cnpm安装报错 npm ERR! enoent ENOENT: no such file or directory, access 'D:\Develop\nodejs\node_global……

一、问题描述

  • windows命令行下运行指令:
npm install -g cnpm --registry=https://registry.npm.taobao.org
  • 出现如下错误:
npm ERR! path D:\Develop\nodejs\node_global\node_modules\cnpm\node_modules\getpass
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'D:\Develop\nodejs\node_global\node_modules\cnpm\node_modules\getpass'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\Develop\nodejs\node_cache\_logs\2019-08-14T14_04_21_545Z-debug.log

二、解决问题

1. 依次输入以下命令:

npm set registry https://registry.npm.taobao.org  # 注册模块镜像
npm set disturl https://npm.taobao.org/dist  # node-gyp 编译依赖的node源码镜像
npm cache clean --force  # 清空缓存

2. 若上述方法任然报错,那么将no such file or directory,access中指明的文件路径中的node_modules手动删除,最后再npm命令从新安装淘宝cnpm淘宝镜像。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值