[码上追溯] npx Could not install from "Files\nodejs\node_cache\_npx\18476" as it does not contain a pac

windows10 下运行 #npx -v 提示如下错误

[码上追溯] npx Could not install from
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”之间没有空格。


 

你可能感兴趣的:(前端技术,node.js)