尝试设置反应,但是npm start命令给我ENOENT错误

时间:2020-06-01 12:55:35

标签: npm

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

C:\Work\React_App>npm -v
6.14.5

C:\Work\React_App>node -v
v12.16.1

1 个答案:

答案 0 :(得分:0)

好的,看起来NPM会将.gitignore用作.npmignore文件的基础,因此忽略了/ lib。如果您在应用程序的根目录中添加一个空白的.npmignore文件,则一切正常。

[edit]-此处有关此行为的更多信息:https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package