Ionic3 安装git路径插件遇到的问题

如题:名字无所谓啦!
具体就是在项目升级到Ionic3之后,通过命令行安装插件,例如:
cordova plugin add https://github.com/xxxxxx or ionic cordova plugin add https://github.com/xxxxxx
时候报错信息如下:

0 info it worked if it ends with ok
1 verbose cli [ 'E:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'https://github.com/xxx',
1 verbose cli   '--save' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session e0c46567e228ed06
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for git+https://github.com/hewz/cordova-baidu-location.git Error while executing:
7 silly fetchPackageMetaData C:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://github.com/xxx.git
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData fatal: Unable to find remote helper for 'https'
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData exited with error code: 128
8 verbose stack Error: exited with error code: 128
8 verbose stack     at ChildProcess.onexit (C:\Users\Roronoazoro\AppData\Roaming\npm\node_modules\npm\node_modules\mississippi\node_modules\end-of-stream\index.js:39:36)
8 verbose stack     at emitTwo (events.js:125:13)
8 verbose stack     at ChildProcess.emit (events.js:213:7)
8 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
9 verbose cwd C:\Users\Roronoazoro\lj3\node_modules
10 verbose Windows_NT 10.0.15063
11 verbose argv "E:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Roronoazoro\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/hewz/cordova-baidu-location" "--save"
12 verbose node v8.2.1
13 verbose npm  v5.3.0
14 error Error while executing:
14 error C:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://github.com/hewz/cordova-baidu-location.git
14 error
14 error fatal: Unable to find remote helper for 'https'
14 error
14 error exited with error code: 128
15 verbose exit [ 1, true ]


大致意思呢就是不支持或者找不到“https”这个协议;

解决方案为:设置GIT环境变量,

特此说明:GIT安装后默认会在PATH下面设置环境变量,但是默认的是git目录下的cmd目录,此时安装插件就会报错如上信息,把环境变量 重置为git目录下的bin目录即可。问题解决!

你可能感兴趣的:(ionic,git)