我刚刚创建了一个 React 应用程序,它工作正常但是一旦我重新启动编辑器它就会抛出这样的错误:
Poojas-MacBook-Air:newreact pooja$ npm start
npm ERR! path /Users/pooja/Desktop/projects/newreact/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open
'/Users/pooja/Desktop/projects/newreact/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! /Users/pooja/.npm/_logs/2020-11-28T10_27_42_118Z-debug.log
如果有人知道,请帮忙。
原文由 Pooja Kushwah 发布,翻译遵循 CC BY-SA 4.0 许可协议
npm install -g npm
)。rm -rf node_modules package-lock.json
npm install