【发布时间】:2021-12-18 08:45:30
【问题描述】:
当调用npm install 或npm install --save 时,代码会抛出相同的错误。
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/andyc/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/andyc/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/andyc/.npm/_logs/2021-11-04T02_19_18_554Z-debug.log
知道为什么会这样吗?
【问题讨论】:
-
没有包。 json 文件在当前目录中。