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