安装angular-cli工具出现的问题以及总结

在尝试使用npm全局安装gcnpm并指定registry为https://registry.npm.taobao.org时,遇到了`npm ERR! code ERR_STREAM_DESTROYED`和`EPERM: operation not permitted`的错误。这可能是由于文件被占用或者权限不足导致。解决方案是重新以管理员权限打开CMD执行命令。如果已全局安装过,无需再次安装。可以使用`npm list --depth=0 --global`查看全局安装的包。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

执行以下语句
npm install -g cnpm --registry=https://registry.npm.taobao.org
出现报错:


```python
npm ERR! code ERR_STREAM_DESTROYED
npm ERR! Cannot call write after a stream was destroyed
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path D:\software\node\npm_cache\_cacache\tmp\0a94ade1
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'D:\software\node\npm_cache\_cacache\tmp\0a94ade1'
npm ERR!  [OperationalError: EPERM: operation not permitted, open 'D:\software\node\npm_cache\_cacache\tmp\0a94ade1'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, open 'D:\software\node\npm_cache\_cacache\tmp\0a94ade1'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'open',
npm ERR!     path: 'D:\\software\\node\\npm_cache\\_cacache\\tmp\\0a94ade1'
npm ERR!   },
npm ERR!   isOperational: true,
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'open',
npm ERR!   path: `在这里插入代码片`'D:\\software\\node\\npm_cache\\_cacache\\tmp\\0a94ade1'
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.

解决办法:重新打开cmd以管理员身份运行

(npm install -g是全局安装的意思,安装过一次就不用再安装了
npm list --depth=0 --global:列出全局安装的包)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值