1

我只是将一个 Ionic 项目克隆到我的电脑上,因为使用了 .gitignore 指令中没有安装 node_modules ...所以当我在 CLI 中输入 ionic serve 时,它​​给出了这个错误

? 看起来像一个新的结帐!找不到 ./node_modules 目录。您要安装项目依赖项吗?是的,安装依赖项可能需要几分钟!

npm i × 运行命令 - 失败![错误] 运行 npm i 时发生错误(退出代码 1):

    npm ERR! code 1
    npm ERR! Command failed: C:\Program Files\Git\cmd\git.EXE submodule update -q --init --recursive
    npm ERR! C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: basename: command not found
    npm ERR! C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: sed: command not found
    npm ERR! C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 19: .: git-sh-setup: file not found
    npm ERR!

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\malre\AppData\Roaming\npm-cache\_logs\2018-06-28T14_57_56_909Z-debug.log

我该怎么做才能解决这个问题?

谢谢你

4

1 回答 1

1

您使用的是哪个文件系统?你碰巧在 windows 上使用 bash 吗?你跑了npm install -g ionic cordova吗?如果那是您失败的地方,请以管理员身份运行您使用的任何终端或npm ias root

那应该可以解决您的问题。

于 2018-06-28T15:53:29.133 回答