又是阿里云npm install报错:ENOENT: no such file or directory, open ‘/root/package.json‘
在阿里云ECS的linux上执行
npm install
报错如下:
npm error code ENOENT
npm error syscall open
npm error path /root/package.json
npm error errno -2
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/root/package.json'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
如下图:
根据进一步指引,查看log文件:
初步判断是没有/root/package.json这个配置文件造成。
错误分析
从提供的错误信息来看,这是在使用 npm 进行操作(可能是 npm install)时出现的错误。具体错误信息为 ENOENT: no such file