原因分析:node路径带有空格
执行
npm config get cache
得到 D:\Program Files\nodejs\node_modules\npm\node_cache
看到确实是program files 之间有空格
解决方案:
执行:npm config edit
将带空格的路径改写为:D:\Program~1\nodejs\node_modules\npm\node_cache (这是 windows 的一种路径表达方式)
或者直接执行
npm config set cache "D:\Program~1\nodejs\node_modules\npm\node_cache"--global