簡體   English   中英

錯誤:EPERM:不允許操作安裝 ionic 3 和 cordova

[英]Error: EPERM: operation not permitted installing ionic 3 and cordova

我第一次嘗試在我的桌面上安裝 ionic 3 和 cordova。 我正在使用 Windows 7。

npm install -g ionic cordova

給我看這個錯誤:

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
C:\Users\amir\AppData\Roaming\npm\cordova -> C:\Users\amir\AppData\Ro
C:\Users\amir\AppData\Roaming\npm\ionic -> C:\Users\amir\AppData\Roam
npm ERR! path C:\Users\amir\AppData\Roaming\npm\node_modules\ionic\no
.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\amir
s\fsevents\node_modules\ansi-regex\package.json'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, unlink 'C:\Users\a
ules\fsevents\node_modules\ansi-regex\package.json'
npm ERR!     at Error (native)
npm ERR!   stack: 'Error: EPERM: operation not permitted, unlink \'C:
\ionic\\node_modules\\fsevents\\node_modules\\ansi-regex\\package.jso
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\amir\\AppData\\Roaming\\npm\\node_module
i-regex\\package.json' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

我嘗試以管理員模式進入 Windows PowerShell,但問題沒有解決。 有什么想法嗎?

我解決了這個問題。

這與節點 uuid 無關。

我只是去 appData/Roaming/npm 然后我刪除了

節點模塊文件夾

npm 緩存

然后,它起作用了

答案在這里: https: //stackoverflow.com/a/44150369/6291722 node-uuid@1.4.8 是舊模塊,需要升級,或者升級NodeJs本身。

我遇到了同樣的問題,通過將 npm 從 5.4.0 降級到 5.3.0 來修復它。

npm install npm@5.3.0

我在不同的情況下遇到了同樣的問題(我試圖運行以前可以正常工作的npm publish )。

我通過使用npm install -g npm升級 npm 解決了這個問題。 這安裝了 npm@6.9.0。

以管理員身份運行對我有用! :)

暫無
暫無

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

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