创建vite项目报错:Could not install from “xxxx“ as it does not contain a package.json file.

创建vite项目报错:Could not install from "xxxx" as it does not contain a package.json file.

在这里插入图片描述

报错原因:路径存在空格

// 运行指令
npm config get cache
返回结果
C:\Users\big Boss\AppData\Roaming\npm-cache

在这里插入图片描述

解决方案

1、将big Boss 改为big~1

// 运行指令   
npm config set cache "C:\Users\big~1\AppData\Roaming\npm-cache" --global

2、运行命令在文件中调整

// 运行指令
npm config edit

在这里插入图片描述

将文件路径中的big boss 改为big~1

猜你喜欢

转载自blog.csdn.net/m0_50207524/article/details/132949080