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

相关推荐
kyriewen4 小时前
别再 console.log 了:5 个 Chrome DevTools 调试技巧,用过就回不去了
前端·javascript·面试
IT_陈寒6 小时前
Python搞不定字符串编码?这破玩意坑我两小时!
前端·人工智能·后端
DigitalOcean7 小时前
Laravel 开发者已在 DigitalOcean 上开通超过 10 万台服务器
前端·laravel
星始流年7 小时前
从 Tool 到 Skill——基于 LangChain 的服务端Skill实现
前端·langchain·agent
李惟8 小时前
开源本地通信库,纯客户端 RPC,像聊天一样通信
前端
YAwu118 小时前
深入解析 React 炫彩鼠标跟随标题组件:从坐标定位到动画性能
前端·react.js
GuWenyue8 小时前
排序效率低?5分钟吃透快速排序,性能飙升至O(nlogn)
前端·javascript·面试
OpenTiny社区8 小时前
🎨 看完 GenUI SDK 源码我悟了!
前端·vue.js·github
叁两8 小时前
前端转型AI Agent该如何学习?(前置篇)
前端·人工智能·node.js
何时梦醒8 小时前
深入理解递归与快速排序 —— 从基础入门到手写实现
前端·javascript