npm安装错误:“ ENOENT:没有这样的文件或目录”

时间:2019-05-21 03:41:48

标签: angular npm npm-install package.json npm-scripts

我将项目表单下载到某个地方,然后运行'npm install',我得到了:

npm ERR! path /Users/<username>/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/<username>/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

但是我已经检查了项目,那里有一个package.json文件: /Users/username/Desktop/Directory/Projects/ProjectName/package.json

我需要使用npm init创建另一个吗?

1 个答案:

答案 0 :(得分:0)

cd到该目录npm install,然后再次运行React.FunctionComponent