【问题标题】:i am trying to run the command npm install in visual code but it is showing me this error我正在尝试在可视代码中运行命令 npm install 但它向我显示此错误
【发布时间】:2021-10-14 13:23:27
【问题描述】:

[

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\sahib\Downloads\generative-art-node-main (1)> npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\sahib/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\sahib\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!     C:\Users\sahib\AppData\Local\npm-cache\_logs\2021-10-14T13_21_21_398Z-debug.log
PS C:\Users\sahib\Downloads\generative-art-node-main (1)> ][1]

【问题讨论】:

标签: javascript node.js npm-install


【解决方案1】:

您是否从包含package.json 的文件夹中运行npm install。通过运行ls 命令验证这一点,并查看输出中是否列出了 package.json

你输入了

PS C:\Users\sahib\Downloads\generative-art-node-main (1)> npm install

但错误是在查找两个目录上的内容:

npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\sahib\package.json'

这表明您尝试安装的 package.json 中有一些奇怪/错误。

【讨论】:

  • 你能说得更具体一些吗\
  • 错误是在 C:\Users\sahib 中寻找 package.json——你在 package.json 中有什么奇怪的东西在那个 package.json 中引用了“../..” ?
猜你喜欢
  • 1970-01-01
  • 2020-04-20
  • 2021-12-07
  • 1970-01-01
  • 2020-01-28
  • 2014-11-11
  • 1970-01-01
  • 1970-01-01
  • 2020-06-07
相关资源
最近更新 更多