【发布时间】: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