windows10 下运行 #npx -v 提示如下错误
16 error code ENOLOCAL
17 error Could not install from "Files\nodejs\node_cache\_npx\18476" as it does not contain a package.json file.
18 verbose exit [ 1, true ]
解决方案:
“更换node cache 路径”
在项目目录下面运行:
#npm config set cache "C:\Users\登录windows的用户名\AppData\Roaming\npm-cache"--global
切记目录和“--global”之间没有空格。