今天git工程出现的了一个问题
同步是没有问题的
不能提交
改动任何东西 提交就汇报下面这个错
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/tx/sdwvc7x5055034ntbz2mxyxh0000gn/T/SourceTreeTemp.y41tmH
env: node: No such file or directory
Completed with errors, see above
请问这是什么情况?
env: node:是什么东西呢??
这与我加了.eslint文件有关吗???
谢谢!!!!!!
PS:
切换分支页会报错
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree checkout master
Switched to branch 'master'
env: node: No such file or directory
Your branch is up-to-date with 'origin/master'.
Completed with errors, see above
Have you tried git status to see what changes have affected it
Reference URL, I don’t know if it will be useful to you
https://answers.atlassian.com...
Based on your situation, make a bold guess.
Since you said, there will be problems when
commit
andcheckout
are used,git status
is fine. The wrong part isenv node
. So, there are two possibilities:The hook triggered during commit cannot find the node running environment
In my impression,
eslint
depends onnode
, so if the node cannot be found, this error may also be reportedThe first situation means that, for example, every time you commit, the unit test must be automatically run first, and the test will be submitted only after the test passes. At this time, if the node environment that the test depends on cannot be found, it will definitely not be run or submitted.
Solving eslint problems is easy, just configure the environment.
As for the first situation:
First, switch to the command line and try to see if it can be submitted. Looking at the screenshot, you should be using GitHub Desktop? This is not recommended at all
Secondly, check your environment configuration. For example, if you use gulp or grunt, see if there are any environment variables defined. If the configuration file defines running node from a certain path, and your local path does not correspond to the one specified, an error will also be reported.