React踩坑-安裝npm install fetch-jsonp報錯

在Visual Studio Code的終端控制檯裏面安裝npm install fetch-jsonp模塊的時候報出這樣的錯誤:node

PS D:\react\reactdemo> npm install fetch-jsonp
Unhandled rejection Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\ddf500a8'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>
PS D:\react\reactdemo>
 
5640239-10f1145bb9af0e1d.png
 

這個時候,須要打開cmd,以管理員身份運行,進入到d盤的React項目裏面,運行npm install fetch-jsonp,安裝fetch-jsonp模塊,便可react


 
5640239-a32674ef9f274b14.png
 

後面總結了一下,其實最好用的辦法就是在Visual Studio Code的終端控制檯運行命令:npm

cnpm install fetch-jsonp --save
 
5640239-b4a19b602be54e87.png