npm正在产生错误或不良行为。
怎么了文件git flow
中的package.json
命令无效。
文件package.json
包含:
json
"scripts": {
"s1": "git flow release start v1",
"s2": "git flow"
},
命令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
答案 0 :(得分:0)
最后,问题解决了。
添加了指向PATH C:\ Program Files \ Git \ usr \ bin
的路径
并开始工作...
谁该怪? NPM还是GIT ???
注意! Gitflow命令无需NPM即可工作