当我运行npm install和npm start时,它会不断显示以下消息

时间:2020-08-15 01:18:18

标签: node.js python-3.x npm terminal

namish @ namishs-mbp〜%npm安装

npm WARN saveError ENOENT: no such file or directory, open '/Users/namish/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/namish/package.json'
npm WARN namish No description
npm WARN namish No repository field.
npm WARN namish No README data
npm WARN namish No license field.

up to date in 0.727s
found 0 vulnerabilities

此后,我尝试运行npm start。当我这样做时,会发生以下情况:

namish @ namishs-mbp〜%npm开始

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/namish/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/namish/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/namish/.npm/_logs/2020-08-15T01_15_06_560Z-debug.log```

I don't know why this says this. Is there any way to fix it?

1 个答案:

答案 0 :(得分:0)

检查package.json的文件位置,然后重试或使用npm init创建一个文件