gpt4 book ai didi

node.js - 尝试安装项目依赖项时运行 npm i(退出代码 1)时发生错误

转载 作者:太空宇宙 更新时间:2023-11-04 00:08:28 25 4
gpt4 key购买 nike

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

?看起来像是新鲜出炉的结账!未找到 ./node_modules 目录。您想安装项目依赖项吗?是的安装依赖项可能需要几分钟!

npm i × Running command - failed! [ERROR] An error occurred while running npm i (exit code 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

我可以做什么来解决这个问题?

谢谢

最佳答案

您使用的是哪个文件系统?你碰巧在 Windows 上使用 bash 吗?您是否运行了 npm install -g ionic cordova ?如果这就是您失败的地方,请以管理员身份运行您正在使用的终端或以 root 身份运行 npm i

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

关于node.js - 尝试安装项目依赖项时运行 npm i(退出代码 1)时发生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51086687/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com