Error: EPERM: operation not permitted, unlink

npm 安裝依賴包時報錯。

npm ERR! path D:\workspace\gddn-videomonitorsetting\node_modules\.staging\typescript-a56f33a2\lib\typescript.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\workspace\gddn-videomonitorsetting\node_modules\.staging\typescript-a56f33a2\lib\typescript.js'
npm ERR!  { [Error: EPERM: operation not permitted, unlink 'D:\workspace\gddn-videomonitorsetting\node_modules\.staging\typescript-a56f33a2\lib\typescript.js']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, unlink 'D:\workspace\gddn-videomonitorsetting\node_modules\.staging\typescript-a56f33a2\lib\typescript.js'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'unlink',
npm ERR!      path:
npm ERR!       'D:\\workspace\\gddn-videomonitorsetting\\node_modules\\.staging\\typescript-a56f33a2\\lib\\typescript.js' },
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, unlink \'D:\\workspace\\gddn-videomonitorsetting\\node_modules\\.staging\\typescript-a56f33a2\\lib\\typescript.js\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path:
npm ERR!    'D:\\workspace\\gddn-videomonitorsetting\\node_modules\\.staging\\typescript-a56f33a2\\lib\\typescript.js',
npm ERR!   parent: 'ant-design-pro' }
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).

operation not permitted:操作不允許

1.排除是否有權限問題,可以用管理員身份運行一下。
2.如果沒有權限問題,可以在C:\Users{賬戶}\下的.npmrc文件. 即清除npm緩存
(也可以使用命令清除緩存 npm cache clean --force)
3.再次運行npm i: ok啦

?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

  • 描述 npm從以下來源獲取配置值,按優(yōu)先級排序: 命令行標記 在命令行上放置--foo bar設置foo配置參數(shù)為...
    竹天亮閱讀 44,496評論 0 8
  • NPM依賴包版本號~和^和*的區(qū)別: ~ 會匹配最近的小版本依賴包,比如~1.2.3會匹配所有1.2.x版本,但是...
    宋song一閱讀 1,143評論 0 0
  • npm是什么 NPM的全稱是Node Package Manager,是隨同NodeJS一起安裝的包管理和分發(fā)工具...
    build1024閱讀 8,128評論 0 9
  • 報錯——operation not permitted(沒有許可證) 【原因】npm的版本過高,導致一些依賴包下載...
    簡小園閱讀 42,686評論 2 6
  • Swift1> Swift和OC的區(qū)別1.1> Swift沒有地址/指針的概念1.2> 泛型1.3> 類型嚴謹 對...
    cosWriter閱讀 11,641評論 1 32

友情鏈接更多精彩內(nèi)容