有什么办法可以清除此npm错误

时间:2020-05-22 12:28:02

标签: node.js npm

$npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/gatua/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/gatua/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!     /home/gatua/.npm/_logs/2020-05-22T12_23_50_208Z-debug.log

1 个答案:

答案 0 :(得分:1)

仅在项目文件夹外部运行npm命令。如果不是这样。首先,您需要通过运行npm init命令来创建package.json文件。