【问题标题】:Bad: git cloning problems不好:git克隆问题
【发布时间】:2021-06-03 13:57:36
【问题描述】:

克隆后当我尝试安装时显示以下警告并且无法安装。我之前克隆了这个 repo 一次,它克隆成功。但在那之后我卸载了 git 并删除了所有克隆的内容。现在,当我再次尝试克隆时,我会遇到一些错误和警告。

  C:\Users\91830>git clone https://github.com/example/example.git

Cloning into 'example'...
remote: Enumerating objects: 51, done.
remote: Counting objects: 100% (51/51), done.
remote: Compressing objects: 100% (43/43), done.
Receiving objects:  76% (39/51), 7.79 MiB | 2.18 MiB/sreused 0 eceiving objects:
  72% (37/51), 7.79 MiB | 2.18 MiB/s
Receiving objects: 100% (51/51), 9.39 MiB | 2.35 MiB/s, done.
Resolving deltas: 100% (8/8), done.
C:\Users\91830>npm install
npm WARN saveError ENOENT: no such file or directory, open
'C:\Users\91830\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open
 'C:\Users\91830\package.json'
npm WARN 91830 No description
npm WARN 91830 No repository field.
npm WARN 91830 No README data
npm WARN 91830 No license field.
up to date in 0.795s
found 0 vulnerabilities

【问题讨论】:

  • 克隆似乎成功了,问题似乎与您的npm有关。您需要在 repo 文件夹中才能运行。请参阅下面的解决方法。
  • 为什么觉得git有问题?此外,警告非常清楚,package.json 缺少一些 npm 更愿意拥有的字段。
  • npm 安装中存在问题。您可以尝试使用npm ci 代替 npm install 并检查您是否收到此错误。

标签: git github npm git-clone cloning


【解决方案1】:

看起来问题不是源于git clone(那是成功的),而是您尝试了npm install 上面的一个目录。 git clone 默认创建一个文件夹。应该有一个名为 Online-shopping-platform 的文件夹。

试试:

cd Online-shopping-platform
npm install

请注意,这在 repo 中有明确说明:

要在您的机器上获取代码:首先,在您的机器上克隆 repo。克隆后,使用命令行,移至该仓库并运行以下命令:

npm 安装

npm 开始

【讨论】:

    猜你喜欢
    • 2011-03-08
    • 2013-10-03
    • 1970-01-01
    • 2010-11-20
    • 2022-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多