hcg1023
2019-03-03 20:53
采纳率: 50%
浏览 9.3k

使用npm下载任何文件都报错,报错如下

D:\cumputer\Node_js\day_3_3>npm install --save jquery
npm WARN tarball tarball data for jquery@latest (sha1-lYzinoHJeQ8xvneS311NlfxX+8o=) seems to be corrupted. Trying one more time.
npm WARN cumputer@1.0.0 No description
npm WARN cumputer@1.0.0 No repository field.

npm ERR! path D:\cumputer\node_modules.staging\jquery-9ce1137a\dist\jquery.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\cumputer\node_modules.staging\jquery-9ce1137a\dist\jquery.js'
npm ERR! { [Error: EPERM: operation not permitted, unlink 'D:\cumputer\node_modules.staging\jquery-9ce1137a\dist\jquery.js']
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink 'D:\cumputer\node_modules.staging\jquery-9ce1137a\dist\jquery.js'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR! 'D:\cumputer\node_modules\.staging\jquery-9ce1137a\dist\jquery.js' },
npm ERR! stack:
npm ERR! 'Error: EPERM: operation not permitted, unlink \'D:\cumputer\node_modules\.staging\jquery-9ce1137a\dist\jquery.js
\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR! 'D:\cumputer\node_modules\.staging\jquery-9ce1137a\dist\jquery.js',
npm ERR! parent: 'cumputer' }
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 ERR! A complete log of this run can be found in:
npm ERR! C:\Users\22938\AppData\Roaming\npm-cache_logs\2019-03-03T12_51_08_378Z-debug.log

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • 已采纳

    你试试这两个命令
    npm config rm proxy
    npm config rm https-proxy
    希望对你有帮助

    点赞 3 评论

相关推荐 更多相似问题