【问题标题】:errno -4048 on npm install in Angular projectAngular 项目中 npm 安装上的 errno -4048
【发布时间】:2019-04-18 21:02:27
【问题描述】:

我有一个 Angular 项目,我将为客户端做一些更改,当我尝试运行 npm install 时出现此错误:

npm ERR! path D:\myClientProject\node_modules\.staging\material-design-icons-f132a428\av\1x_web\ic_music_video_white_36dp.png
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\myClientProject\node_modules\.staging\material-design-icons-f132a428\av\1x_web\ic_music_video_white_36dp.png'
npm ERR!  { [Error: EPERM: operation not permitted, unlink 'D:\myClientProject\node_modules\.staging\material-design-icons-f132a428\av\1x_web\ic_music_video_white_36dp.png']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, unlink 'D:\myClientProject\node_modules\.staging\material-design-icons-f132a428\av\1x_web\ic_music_video_white_36dp.png'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'unlink',
npm ERR!      path:
npm ERR!       'D:\\myClientProject\\node_modules\\.staging\\material-design-icons-f132a428\\av\\1x_web\\ic_music_video_white_36dp.png' },
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, unlink \'D:\\myClientProject\\node_modules\\.staging\\material-design-icons-f132a428\\av\\1x_web\\ic_music_video_white_36dp.png\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path:
npm ERR!    'D:\\myClientProject\\node_modules\\.staging\\material-design-icons-f132a428\\av\\1x_web\\ic_music_video_white_36dp.png',
npm ERR!   parent: 'emaua-front' }
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).

我已经尝试了一些事情,但没有成功:

  • 以管理员身份使用 cmd 运行命令
  • 授予项目文件夹中的所有权限
  • 删除 package-lock.json
  • 重启电脑
  • 已删除 npm 和 npm-cache 文件夹

节点版本:10.15.3

NPM 版本:6.4.1

有人遇到过这个错误吗?

【问题讨论】:

  • 您是否尝试将 npm 更新到最新版本:npm i -g npm

标签: angular npm npm-install


【解决方案1】:

尝试安装截至 2019 年 4 月 18 日的最新 npm 版本 v6.9.0

npm i -g npm

这已经多次解决了我的问题。

【讨论】:

    猜你喜欢
    • 2018-06-13
    • 2015-08-31
    • 2022-01-06
    • 2018-01-24
    • 2019-07-07
    • 1970-01-01
    • 1970-01-01
    • 2020-09-17
    • 2023-01-01
    相关资源
    最近更新 更多