执行以下语句
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:列出全局安装的包)