簡體   English   中英

npm 安裝-g @sanity/cli npm 錯誤:代碼 EPERM npm 錯誤! 系統調用 mkdir npm 錯誤! 路徑 C:\Program Files\Git\usr\local npm 錯誤! 錯誤號-4048

[英]npm install -g @sanity/cli npm ERR! code EPERM npm ERR! syscall mkdir npm ERR! path C:\Program Files\Git\usr\local npm ERR! errno -4048

npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\Git\usr\local
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\Git\usr\local'
npm ERR!  [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\Git\usr\local'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\Git\\usr\\local'
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.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Razor\AppData\Local\npm-cache\_logs\2022-05-02T11_23_07_449Z-debug.log

1個

這行看起來很奇怪: npm ERR: path C:\Program Files\Git\usr\local

您是否在某個時候運行npm config set prefix /usr/local 看起來 npm 在mkdir命令上失敗了,這更多的是權限或配置問題,而不是 Sanity/Javascript/Express 問題。

您可以嘗試按照此答案的說明進行操作,或者——如果這不起作用—— 此處的cache clean注釋

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM