创建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.

  • 报错原因:路径存在空格
  • 解决方案
    • 1、将big Boss 改为big~1
    • 2、运行命令在文件中调整
    • 将文件路径中的big boss 改为big~1

在这里插入图片描述

报错原因:路径存在空格

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

创建vite项目报错:Could not install from “xxxx“ as it does not contain a package.json file._第1张图片

解决方案

1、将big Boss 改为big~1

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

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

// 运行指令
npm config edit

创建vite项目报错:Could not install from “xxxx“ as it does not contain a package.json file._第2张图片

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

你可能感兴趣的:(vue问题解决,vue.js,前端,javascript)