出现如下报错:
D:\project\vue_4> npm run serve
npm ERR! path D:\project\vue_4\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directopen roject\vue_4\package.json'
npm ERR! enoent ENOENT: no such file or directonpm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
错误原因:是自己在vue cli3初始化项目后,直接在刚才创建的项目名称的外部文件夹运行了
npm run serve这段代码,所以才找不到package.json,应该要进入刚才的项目里运行代码。
进入项目:cd xxxxx