Errors installing Phonegap/Cordova - Nodejs

Asked

Viewed 454 times

2

Your environment has been set up for using Node.js 0.12.6 (x64) and npm.

C:\Users\Alexandre>npm install -g phonegap
npm **WARN** addRemoteGit Error: not found: git

npm **WARN** addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_mo
dules\which\which.js:72:28)

npm **WARN** addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_mo
dules\which\which.js:75:29)
npm **WARN** addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modul
es\which\which.js:83:16

npm **WARN** addRemoteGit     at FSReqWrap.oncomplete (fs.js:95:15)

npm **WARN** addRemoteGit  git+https://github.com/imhotep/plugman.git#0.5.7 resettin
g remote C:\Users\Alexandre\AppData\Roaming\npm-cache\_git-remotes\https-github-
com-imhotep-plugman-git-20c32d58 because of error: { [Error: not found: git] cod
e: 'ENOGIT' }

npm **WARN** addRemoteGit Error: not found: git

npm **WARN** addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_mo
dules\which\which.js:72:28)

npm **WARN** addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_mo
dules\which\which.js:75:29)

npm **WARN** addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modul
es\which\which.js:83:16

npm **WARN** addRemoteGit     at FSReqWrap.oncomplete (fs.js:95:15)

npm **WARN** addRemoteGit  git+https://github.com/filmaj/node-plist.git resetting re
mote C:\Users\Alexandre\AppData\Roaming\npm-cache\_git-remotes\https-github-com-
filmaj-node-plist-git-653fe22e because of error: { [Error: not found: git] code:
 'ENOGIT' }

npm **ERR!** git clone --template=C:\Users\Alexandre\AppData\Roaming\npm-cache\_git-
remotes\_templates --mirror https://github.com/filmaj/node-plist.git C:\Users\Al
exandre\AppData\Roaming\npm-cache\_git-remotes\https-github-com-filmaj-node-plis
t-git-653fe22e: undefined

npm **ERR!** git clone --template=C:\Users\Alexandre\AppData\Roaming\npm-cache\_git-
remotes\_templates --mirror https://github.com/filmaj/node-plist.git C:\Users\Al
exandre\AppData\Roaming\npm-cache\_git-remotes\https-github-com-filmaj-node-plis
t-git-653fe22e: undefined

npm **ERR!** git clone --template=C:\Users\Alexandre\AppData\Roaming\npm-cache\_git-
remotes\_templates --mirror https://github.com/imhotep/plugman.git C:\Users\Alex
andre\AppData\Roaming\npm-cache\_git-remotes\https-github-com-imhotep-plugman-gi
t-20c32d58: undefined

npm **ERR!** git clone --template=C:\Users\Alexandre\AppData\Roaming\npm-cache\_git-
remotes\_templates --mirror https://github.com/imhotep/plugman.git C:\Users\Alex
andre\AppData\Roaming\npm-cache\_git-remotes\https-github-com-imhotep-plugman-gi
t-20c32d58: undefined

npm **ERR!** Windows_NT 6.1.7601

npm **ERR!** argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phonegap"

npm **ERR!** node v0.12.6

npm **ERR!** npm  v2.11.2

npm **ERR!** code ENOGIT

npm **ERR!** not found: git

npm **ERR!**

npm **ERR!** Failed using git.

npm **ERR!** This is most likely not a problem with npm itself.

npm **ERR!** Please check if you have git installed and in your PATH.

npm **ERR!** Please include the following file with any support request:

npm **ERR!**     C:\Users\Alexandre\npm-debug.log

Anyway, up there is the log, which can be?

  • 1

    And you have git installed on that machine?

  • @Brunocésar, yes, I installed it a little while ago(1 hour ago).

1 answer

2


The problem is that you probably don’t have git installed in this environment, since git is not recognized with a command, since the log displays the following error message:

Error: not found: git

If installed, include it in the environment/user variables.

To solve this, do download for Windows and install it. After installation, running echo %PATH% in the prompt command you should notice on the output something that contains the installation path, something like this:

C:\Program Files (x86)\git\cmd

If you have this on the output the command is likely git will be recognized. To be sure, type git --version and the version of git. After this, the npm no longer present this error.

EDITION: including installation information on changing the environment variable PATH

When installing the git, by default the first option is selecting, as below:

Instalação de git no Windows

Note that it is said that with this option the environment variable PATH will not be changed, so you will be able to use only by bash and GUI installed (i.e., being directly accessed).

However, as is the case with npm, some applications/utilities need it to be recognized as a command/application, which makes it necessary that PATH be updated. For this, you must update such variable including the directory you are in git.exe.

For information on how to change the variable PATH, see in How to change PATH in Windows

  • Had already made the installation, directory is present, but on the output of echo %PATH% something totally different comes out. git --version, git is not recognized as a command.. .

  • 1

    @Alexandrec.Caus then git is not in the expensive variables, confirm this. The echo %PATH% will print a lot, the git directory is a part only.

  • Well, I reviewed the installation here, and since I left it all sorted by the GIT default, GIT wasn’t recognized at the command prompt (CMD), well, only at BASH (I didn’t even know it was different from CMD), so I put the option in CMD and now everything’s OK so far! If it is possible to update your answer with this specific solution(to complement your one that is more complete!).

  • 1

    @Alexandrec.Caus ok, I’ll include this remark, but the error itself is that it’s not in the environment variables, you can even use git bash, but it has nothing to do with what the native prompt recognizes

  • 1

    @Alexandrec.Caus updated =)

  • It was perfect for me now, with this complement I understood the difference between the first and second option. Thank you and hugs.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.