npm install -g cnpm --registry=https://registry.npm.taobao.org 报错

npm install -g cnpm --registry=https://registry.npm.taobao.org npm

ERR! code CERT_HAS_EXPIRED npm ERR! errno CERT_HAS_EXPIRED npm ERR! request to https://registry.npm.taobao.org/cnpm failed, reason: certificate has expired npm ERR! Log files were not written due to an error writing to the directory: D:\nodejs\node_cache\_logs npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

这个错误是因为证书过期导致的。你可以尝试使用以下命令来解决这个问题:

npm config set strict-ssl false npm install -g cnpm --registry=https://registry.npm.taobao.org

npm install -g cnpm --registry=https://registry.npm.taobao.org npm ERR! code EPERM npm ERR! syscall mkdir npm ERR! path D:\nodejs\node_cache\_cacache npm ERR! errno -4048 npm ERR! Error: EPERM: operation not permitted, mkdir 'D:\nodejs\node_cache\_cacache' npm ERR! [Error: EPERM: operation not permitted, mkdir 'D:\nodejs\node_cache\_cacache'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'D:\\nodejs\\node_cache\\_cacache', npm ERR! requiredBy: '.' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator. npm ERR! Log files were not written due to an error writing to the directory: D:\nodejs\node_cache\_logs npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

|这个错误是因为权限不足导致的。你可以尝试以管理员身份运行命令提示符或终端,然后再执行以下命令:

>

npm config set strict-ssl false

npm install -g cnpm --registry=https://registry.npm.taobao.org

相关推荐
梦650几秒前
Vue 实现动态路由
前端·javascript·vue.js
姜糖编程日记2 分钟前
C++——初识(2)
开发语言·前端·c++
丶乘风破浪丶9 分钟前
Vue项目中判断相同请求的实现方案:从原理到实战
前端·javascript·vue.js
why技术9 分钟前
如果让我站在科技从业者的角度去回看 2025 年,让我选一个词出来形容它,我会选择“vibe coding”这个词。
前端·后端·程序员
worxfr11 分钟前
CSS Flexbox 布局完全指南
前端·css
0思必得011 分钟前
[Web自动化] JS基础语法与数据类型
前端·javascript·自动化·html·web自动化
Dreamcatcher_AC18 分钟前
前端面试高频问题解析
前端·css·html
damo王29 分钟前
how to install npm in ubuntu24.04?
前端·npm·node.js
光影少年30 分钟前
Vue 2 / Vue 3 diff算法
前端·javascript·vue.js
zhixingheyi_tian42 分钟前
Yarn 之 run job
java·开发语言·前端