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

相关推荐
10年前端老司机1 小时前
10道js经典面试题助你找到好工作
前端·javascript
小小小小宇7 小时前
TS泛型笔记
前端
小小小小宇7 小时前
前端canvas手动实现复杂动画示例
前端
codingandsleeping7 小时前
重读《你不知道的JavaScript》(上)- 作用域和闭包
前端·javascript
小小小小宇7 小时前
前端PerformanceObserver使用
前端
zhangxingchao8 小时前
Flutter中的页面跳转
前端
烛阴9 小时前
Puppeteer入门指南:掌控浏览器,开启自动化新时代
前端·javascript
全宝9 小时前
🖲️一行代码实现鼠标换肤
前端·css·html
小小小小宇10 小时前
前端模拟一个setTimeout
前端
萌萌哒草头将军10 小时前
🚀🚀🚀 不要只知道 Vite 了,可以看看 Farm ,Rust 编写的快速且一致的打包工具
前端·vue.js·react.js