Search code examples
node.jsangularionic3node-modulesionic-cli

an error occurred while running npm i (exit code 1) while trying to install project dependencies


I just clone an Ionic project to my pc, as .gitignore was used there was no node_modules installed in the directive ...So when I typed in ionic serve in the CLI it was giving this error

? Looks like a fresh checkout! No ./node_modules directory found. Would you like to install project dependencies? Yes Installing dependencies may take several minutes!

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

what ca I do to resolve this?

thank you


Solution

  • Which file system are you using ? Do you happen to be using bash on windows ? Did you run npm install -g ionic cordova ? If thats where you are failing, please run whichever terminal you are using as administrator or the npm i as root.

    That should fix your issue.