【问题标题】:After cloning the GitHub repository & installing npm through command line gives following error克隆 GitHub 存储库并通过命令行安装 npm 后出现以下错误
【发布时间】:2019-10-19 17:18:01
【问题描述】:

克隆 GitHub 存储库并通过命令行安装 npm 后出现以下错误

npm WARN saveError ENOENT: no such file or directory, open 'E:\Projects\React_Basics\package.json'

【问题讨论】:

  • 检查 react basic 文件夹,里面没有 npm 需要的 package.json 文件
  • 我已经检查过了,但它有 package.json 文件。它还有 package-lock.json 文件

标签: git github npm npm-install


【解决方案1】:

我认为这与 NPM 更改安装行为有关。

您可以通过以下方法解决该问题:

  • 确保在package.json 中正确描述依赖关系
  • 只需输入 npm install 并按 Enter。
  • 如果存在同样的问题,请输入 npm cache clean 并按 Enter 键
  • 输入 npm install -g npm 并按 Enter。
  • 重试npm install

如果尝试了这些方法都没有解决问题,请回复您的 Node.js 版本、NPM 版本、操作系统和正在使用的 package.json。

【讨论】:

    猜你喜欢
    • 2012-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-21
    • 2020-08-27
    • 1970-01-01
    • 2014-11-13
    • 2018-02-08
    相关资源
    最近更新 更多