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

相关推荐
laoli_coding6 小时前
如何配置HTTPS站点访问的免费SSL域名证书
网络协议·https·node.js·ssl
To_OC6 小时前
手写 AI 编程 Agent 的命令执行工具:我被 child_process 坑出来的实战经验
后端·node.js·agent
胡萝卜术6 小时前
从API调用到手写LRU:力扣146「LRU缓存」的哈希表+双向链表终极进化之路
前端·javascript·面试
科技道人6 小时前
记录 默认置灰/禁用 app ‘Search Engine Selector‘ 的disable按钮
开发语言·前端·javascript
天疆说6 小时前
Zotero Connector 在 Edge 里找不到桌面 Zotero(Linux / Zotero 9.0.6 / Edge 150)
linux·前端·edge
李伟_Li慢慢7 小时前
02-从硬件说起WebGL
前端·three.js
kyriewen8 小时前
看了微软几万人用AI编程的数据——效率涨24%的代价没人提
前端·ai编程·claude
2601_963771378 小时前
How to Scale Your WordPress Store Traffic in 2026
前端·php·plugin
亿元程序员9 小时前
老板说我的3D箭头游戏用来做试玩太普通了,没人想玩,让我变点花样...
前端
李伟_Li慢慢9 小时前
01-threejs架构原理-课程简介
前端·three.js