每次我尝试运行npm start命令时都会出现此错误,我试图清除npm缓存仍然没有运气,我是新来响应js的人,请帮助
C:\Users\Staff Member\Desktop\React\react>npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\Staff Member\Desktop\React\react\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Staff Member\Desktop\React\react\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\Staff Member\AppData\Roaming\npm-cache\_logs\2020-09-02T03_34_33_868Z-debug.log
C:\Users\Staff Member\Desktop\React\react>
答案 0 :(得分:0)
打开CLI,然后在目录的根文件夹中运行
npm init --yes
这将自动创建package.json并插入从当前项目中获取的默认值