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

来源:互联网 发布:华中数控车床编程 编辑:程序博客网 时间:2024/06/05 15:39
如题:名字无所谓啦!
具体就是在项目升级到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 ok1 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 npm@5.3.03 info using node@v8.2.14 verbose npm-session e0c46567e228ed065 silly install loadCurrentTree6 silly install readLocalPackageData7 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.git7 silly fetchPackageMetaData7 silly fetchPackageMetaData fatal: Unable to find remote helper for 'https'7 silly fetchPackageMetaData7 silly fetchPackageMetaData exited with error code: 1288 verbose stack Error: exited with error code: 1288 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_modules10 verbose Windows_NT 10.0.1506311 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.113 verbose npm  v5.3.014 error Error while executing:14 error C:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://github.com/hewz/cordova-baidu-location.git14 error14 error fatal: Unable to find remote helper for 'https'14 error14 error exited with error code: 12815 verbose exit [ 1, true ]


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

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

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

原创粉丝点击