2017-08-10 38 views
0

我有承諾的git這個問題目前還沒有像這樣的問題,到現在爲止git的承諾 - N/A」尚未安裝

我可以去rm -rf .git,做所有的設置,然後。 git commit工作得很好,但後來我做了幾個小時,嘗試再次提交此消息。

我應該去安裝nvm,他們要求我安裝嗎?是否有任何後果?

MacBook-Pro-3:testing NYC$ git commit -m "X" 
Found '/Users/NYC/Desktop/testing/frontend/.nvmrc' with version <v6.11.1> 
N/A: version "v6.11.1 -> N/A" is not yet installed. 

You need to run "nvm install v6.11.1" to install it before using it. 
Found '/Users/NYC/Desktop/testing/frontend/.nvmrc' with version <v6.11.1> 
N/A: version "v6.11.1 -> N/A" is not yet installed. 

You need to run "nvm install v6.11.1" to install it before using it. 
husky > npm run -s precommit (node v8.2.1) 

Error: fatal: Not a git repository: '.git' 

    at ChildProcess.<anonymous> (/Users/NYC/Desktop/testing/frontend/node_modules/staged-git-files/index.js:85:19) 
    at emitTwo (events.js:125:13) 
    at ChildProcess.emit (events.js:213:7) 
    at maybeClose (internal/child_process.js:921:16) 
    at Socket.stream.socket.on (internal/child_process.js:348:11) 
    at emitOne (events.js:115:13) 
    at Socket.emit (events.js:210:7) 
    at Pipe._handle.close [as _onclose] (net.js:549:12) 

husky > pre-commit hook failed (add --no-verify to bypass) 

回答

0

(此處爲nvm維護者)

nvm問題好像是因爲你有一個.nvmrc文件,但你也選擇了劫持cd(或者你有一個混帳掛鉤,做的話)並自動調用nvm use

預提交鉤子是husky的一部分,它是處理git提交鉤子的完全不同的工具。

首先,我運行nvm install,只是爲了確保它所要求的節點版本已安裝。

然後,我會檢查.git/hooks並審計您安裝的git鉤子。

之後,事情應該會更好一些。