错误:git 克隆问题

Bad: git cloning problems

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

  C:\Users830>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:\Users830>npm install
npm WARN saveError ENOENT: no such file or directory, open
'C:\Users830\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:\Users830\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

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

尝试:

cd Online-shopping-platform
npm install

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

To get the code on your machine: Firstly, clone the repo on your machine. After cloning, using command line, move to that repo and run the following commands:

npm install

npm start