我的NPC总是显示这个错误 Command failed: C:\"Program Files"\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js config get cache --parseable module.js:487 这只发生在npx上。 (我的npx是来自nodejs官方安装程序)
唯一解决此问题的方法是更新您当前的npm版本。 对于Windows, 以管理员身份运行PowerShell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force npm install -g npm-windows-upgrade npm-windows-upgrade 注意:不要运行 npm i -g npm。相反,使用 npm-windows-upgrade 来更新 npm。另外,如果您运行 NodeJS 安装程序,它会替换节点版本。对于 Ubuntu,sudo npm install npm -g