【避坑总结】创建vue-cli后报错找不到package.json文件

在一次利用vue-cli创建vue项目后,敲入npm run dev后报错找不到package.json文件

npm ERR! path C:\Users\000\Desktop\vue-sign-system\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\000\Desktop\vue-sign-system\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

捣鼓了一通发现我是在C:\Users\000\Desktop\vue-sign-system目录下,并没有cd进项目目录,
刚才在vue-sign-system运行npm init建立vue项目的,忘记cd进去了,所以在此目录下当然没有package.json文件。。。

cd进去后运行npm run dev,正常运行

撒花!

你可能感兴趣的:(避坑总结)