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

相关推荐
WYiQIU4 小时前
11月面了7.8家前端岗,兄弟们12月我先躺为敬...
前端·vue.js·react.js·面试·前端框架·飞书
谢尔登4 小时前
简单聊聊webpack摇树的原理
运维·前端·webpack
娃哈哈哈哈呀4 小时前
formData 传参 如何传数组
前端·javascript·vue.js
zhu_zhu_xia5 小时前
vue3+vite打包出现内存溢出问题
前端·vue
tsumikistep5 小时前
【前后端】接口文档与导入
前端·后端·python·硬件架构
行走的陀螺仪6 小时前
.vscode 文件夹配置详解
前端·ide·vscode·编辑器·开发实践
2503_928411566 小时前
11.24 Vue-组件2
前端·javascript·vue.js
Bigger7 小时前
🎨 用一次就爱上的图标定制体验:CustomIcons 实战
前端·react.js·icon
谢尔登7 小时前
原来Webpack在大厂中这样进行性能优化!
前端·webpack·性能优化
g***B7387 小时前
JavaScript在Node.js中的模块系统
开发语言·javascript·node.js