如何修复来自package.json文件的git flow命令的操作?

时间:2018-07-05 07:41:55

标签: git npm git-flow

我打开这个问题是因为:

npm正在产生错误或不良行为。

怎么了

文件git flow中的package.json命令无效。

文件package.json包含:

json "scripts": { "s1": "git flow release start v1", "s2": "git flow" },

CLI团队如何重现该问题?

命令npm run s1不起作用。
命令npm run s2正常工作。
命令git flow release start v1正常工作。

npm run s1

> wsdl-xsd-parser@1.3.1 s1 C:\temp\temp2\wsdl-xsd-parser
> git flow release start v1

git: 'flow' is not a git command. See 'git --help'.

The most similar commands are
        reflog
        show
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wsdl-xsd-parser@1.3.1 s1: `git flow release start v1`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wsdl-xsd-parser@1.3.1 s1 script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

错误文本有时会更改。由于某些未知原因。

npm run s1

> wsdl-xsd-parser@1.3.1 s1 C:\temp\temp2\wsdl-xsd-parser
> git flow release start v1

C:\Program Files\Git\usr\bin\git-flow: line 47: uname: command not found
C:\Program Files\Git\usr\bin\git-flow: line 76: sed: command not found
C:\Program Files\Git\usr\bin\git-flow: line 76: dirname: command not found
C:\Program Files\Git\usr\bin\git-flow: line 115: /gitflow-shFlags: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wsdl-xsd-parser@1.3.1 s1: git flow release start v1
npm ERR! Exit status 1

版本:

>npm -v  
6.1.0

>node -v  
v8.11.3

>git --version  
git version 2.18.0.windows.1

https://github.com/npm/npm/issues/21152

1 个答案:

答案 0 :(得分:0)

最后,问题解决了。
添加了指向PATH C:\ Program Files \ Git \ usr \ bin
的路径 并开始工作...
谁该怪? NPM还是GIT ???

注意! Gitflow命令无需NPM即可工作