【问题标题】:I can't install npm Mac m1 Monterey我无法安装 npm Mac m1 Monterey
【发布时间】:2021-11-13 07:43:15
【问题描述】:
npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/ahmed/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/ahmed/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/ahmed/.npm/_logs/2021-11-11T23_07_31_793Z-debug.log

每次我尝试安装 rpm 时都会收到此错误,这是路径问题吗?如何解决?

【问题讨论】:

  • 您要究竟使用什么npm install,因为它包含package.json文件?

标签: javascript node.js npm


【解决方案1】:

如果您要安装在 package.json 中添加的软件包,请确保您位于 package.json 所在的路径中

当您不在存在package.json 的文件夹中并且您尝试使用安装包时,通常会出现此错误

npm install

【讨论】:

  • 我搜索了 package.json,但在我的 Mac 中没有找到它,当我在终端中正确 node.js 时,它说没有这样的文件或目录我试图让我复制的代码从一个人在我的电脑上工作,但它要求我下载一些包,我不能。
猜你喜欢
  • 2022-01-17
  • 1970-01-01
  • 2022-11-23
  • 1970-01-01
  • 1970-01-01
  • 2022-01-09
  • 2022-06-22
  • 1970-01-01
  • 2022-01-22
相关资源
最近更新 更多