运行vue项目报错如下:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\username\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open ‘C:\Users\username\package.json’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
原因是没有进入到项目的目录,在执行命令的时候找不到package.json
所以要先进入到项目的目录里面
比如我的项目是在文件夹vueusing下,项目名为firstDemo
运行cd vueusing/firstDemo
再执行npm run dev即可