呵呵!$PATH中找不到 git 二进制文件



我似乎无法让zenbot安装我是node的新手.js,所以请善待。我遇到了各种错误,我确实安装了 git。我按照安装说明进行操作,但我真的不知道从哪里开始。我是一个Java和C编程,试图在新的东西上咬牙切齿,并通过颠簸和瘀伤来学习。

C:zenbot>npm install
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:Users\AppDataRoamingnpm-cache_logs2017-12-25T08_17_27_513Z-debug.log
----- Log file--
0 info it worked if it ends with ok
1 verbose cli [ 'C:\nodejs\node.exe',
1 verbose cli   'C:\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli   'install' ]
2 info using npm@5.5.1
3 info using node@v8.9.3
4 verbose npm-session 5167d752483581f2
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall zenbot4@4.0.5
7 info lifecycle zenbot4@4.0.5~preinstall: zenbot4@4.0.5
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 silly fetchPackageMetaData error for forex.analytics@github:mkmarek/forex.analytics#7bc278987700d4204e959af17de61495941d1a14 No git binary found in $PATH
14 verbose stack Error: No git binary found in $PATH
14 verbose stack     at checkGit (C:nodejsnode_modulesnpmnode_modulespacotelibutilgit.js:199:17)
14 verbose stack     at spawnGit (C:nodejsnode_modulesnpmnode_modulespacotelibutilgit.js:178:10)
14 verbose stack     at pinflight (C:nodejsnode_modulesnpmnode_modulespacotelibutilgit.js:110:12)
14 verbose stack     at C:nodejsnode_modulesnpmnode_modulespromise-inflightinflight.js:29:24
14 verbose stack     at Promise._execute (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleasedebuggability.js:300:9)
14 verbose stack     at Promise._resolveFromExecutor (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleasepromise.js:483:18)
14 verbose stack     at new Promise (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleasepromise.js:79:10)
14 verbose stack     at _inflight (C:nodejsnode_modulesnpmnode_modulespromise-inflightinflight.js:28:25)
14 verbose stack     at C:nodejsnode_modulesnpmnode_modulespromise-inflightinflight.js:22:14
14 verbose stack     at tryCatcher (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleaseutil.js:16:23)
14 verbose stack     at Promise._settlePromiseFromHandler (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleasepromise.js:512:31)
14 verbose stack     at Promise._settlePromise (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleasepromise.js:569:18)
14 verbose stack     at Promise._settlePromiseCtx (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleasepromise.js:606:10)
14 verbose stack     at Async._drainQueue (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleaseasync.js:138:12)
14 verbose stack     at Async._drainQueues (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleaseasync.js:143:10)
14 verbose stack     at Immediate.Async.drainQueues (C:nodejsnode_modulesnpmnode_modulesbluebirdjsreleaseasync.js:17:14)
15 verbose cwd C:zenbot
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\nodejs\node.exe" "C:\nodejs\node_modules\npm\bin\npm-cli.js" "install"
18 verbose node v8.9.3
19 verbose npm  v5.5.1
20 error code ENOGIT
21 error No git binary found in $PATH
22 error Failed using git.
22 error Please check if you have git installed and in your PATH.
23 verbose exit [ 1, true ]

C:WINDOWSsystem32>git -v Unknown option: -v usage: git [--version] [--help] [-C <path>] [-c name=value] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | --no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] <command> [<args>] –

您正在C:WINDOWSsystem32内尝试,可能那里git可执行文件可用。

将目录更改为C:,然后尝试git --version

如果出现错误git无法识别...,则不会在环境变量中设置git路径。

因此,打开环境变量设置并将 git 可执行文件路径设置为PATH变量。

看起来它从高山图像中消失了。 npm install 是 node 的基础,git 是安装某些依赖项所必需的。

包括

RUN apk update && apk upgrade && 
apk add --no-cache git

在 dockerfile 中将修复它。

在 jenkins 上运行 RUN npm install 时 --progress=false --unsafe-perm in docker file

从节点:10.15.0-高山(作为基础图像)

我得到了npm ERR!$PATH中找不到 git 二进制文件

解决方案 - 在 docker 文件中的下方添加,它有效

运行 apk 更新 &&apk 升级 &&
apk add --no-cache git

最新更新