npm ERR! code ENOENT npm ERR! syscall open error solution front-end vue startup error

npm ERR! code ENOENT npm ERR! syscall open error resolution

When starting myvue, the following error occurs

Error details:

E:\项目源码\idea\vue>npm run dev npm ERR! code ENOENT npm ERR! syscall open 
npm ERR! path E:\项目源码\idea\vue\package.json 
npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'E:\Web学习\idea\vue\package.json' 
npm 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: 
npm ERR! C:\Users\yang\AppData\Roaming\npm-cache_logs\2020-11-18T08_47_57_691Z-debug.log

main reason:

The reason is that the package.json file cannot be found, and the startup project path is incorrect

Solution:

Find the corresponding path: E:\project source code\idea\vue>npm run dev (example)

Most people are running npm run dev in the upper directory of myvue at this time, and naturally there is no package.json at this time

Go to the myvue directory and find package.json

Go to the myvue directory and execute startup. Find the target file package.json

Guess you like

Origin blog.csdn.net/weixin_64854388/article/details/129159358