npm 版本升级或降级报错?
来源:2-1 webpack 究竟是什么?
 
			会飞的铁蛋
2019-05-22
延续 https://coding.imooc.com/learn/questiondetail/121612.html  提到的问题自行百度搜索说是 npm 版本问题
但尝试升级或降级 npm 版本又提示错误信息:
升级:
$ npm install -g npm
npm WARN tarball tarball data for https://registry.npmjs.org/npm/-/npm-6.9.0.tgz (sha512-91V+zB5hDxO+Jyp2sUKS7juHlIM95dGQxTeQtmZI1nAI/7kjWXFipPrtwwKjhyKmV4GsS2LzJhrxRjGWsU9z/w==) seems to be corrupted. Trying one more time.
npm ERR! path C:\Users\Chiu\AppData\Local\Temp\npm-18544-0e318d54\unpack-b2e97d99\node_modules\aws-sign2\index.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Chiu\AppData\Local\Temp\npm-18544-0e318d54\unpack-b2e97d99\node_modules\aws-sign2\index.js’
npm ERR!  { [Error: EPERM: operation not permitted, unlink ‘C:\Users\Chiu\AppData\Local\Temp\npm-18544-0e318d54\unpack-b2e97d99\node_modules\aws-sign2\index.js’]
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, unlink 'C:\Users\Chiu\AppData\Local\Temp\npm-18544-0e318d54\unpack-b2e97d99\node_modules\aws-sign2\index.js’
npm ERR!      errno: -4048,
npm ERR!      code: ‘EPERM’,
npm ERR!      syscall: ‘unlink’,
npm ERR!      path:
npm ERR!       ‘C:\Users\Chiu\AppData\Local\Temp\npm-18544-0e318d54\unpack-b2e97d99\node_modules\aws-sign2\index.js’ },
npm ERR!   isOperational: true,
npm ERR!   stack:
npm ERR!    ‘Error: EPERM: operation not permitted, unlink ‘C:\Users\Chiu\AppData\Local\Temp\npm-18544-0e318d54\unpack-b2e97d99\node_modules\aws-sign2\index.js’’,
npm ERR!   errno: -4048,
npm ERR!   code: ‘EPERM’,
npm ERR!   syscall: ‘unlink’,
npm ERR!   path:
npm ERR!    ‘C:\Users\Chiu\AppData\Local\Temp\npm-18544-0e318d54\unpack-b2e97d99\node_modules\aws-sign2\index.js’ }
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 (though this is not recommended).
降级:
$ npm install -g npm@5.4.0
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Chiu\AppData\Roaming\npm-cache_logs\2019-05-21T17_12_16_026Z-debug.log
啥原因咯,真的伤心了,需重新把 node 卸载再重新操作下吗?
2回答
- 
				
				哈哈,官网还有这样的建议呢 012019-05-23
- 
				  会飞的铁蛋 提问者 2019-05-22 可以了,参考官网建议:重装... 00
相似问题
