New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current directory is not a git directory! #500
Comments
Also, experiencing this error on husky > pre-commit (node v12.4.0)
> frontend@0.1.0-beta lint-staged /Users/n/Desktop/n/g/client
> lint-staged
Current directory is not a git directory!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend@0.1.0-beta lint-staged: `lint-staged`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@0.1.0-beta lint-staged script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/n/.npm/_logs/2019-06-10T01_34_51_726Z-debug.log
husky > pre-commit hook failed (add --no-verify to bypass) dir structure:
Running client/package.json: {
"name": "client",
"version": "0.1.0-beta",
"private": true,
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"lint-staged": "lint-staged",
"prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx,scss,less}\"",
"eslint": "eslint --ext .js,jsx src",
"tslint": "tslint \"src/**/*.{ts,tsx}\"",
"stylelint": "stylelint \"src/**/*.{scss,less}\""
},
"husky": {
"hooks": {
"pre-commit": "npm run lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,scss,less}": [
"prettier --write",
"git add"
],
"src/**/*.{js,jsx}": [
"eslint"
],
"src/**/*.{scss,less}": [
"stylelint"
]
},
"dependencies": {
"@rowno/sparkline": "^3.0.1",
"antd": "^3.13.2",
"axios": "^0.18.0",
"bootstrap-css-only": "^4.2.1",
"chart.js": "^2.7.3",
"chartist": "^0.11.0",
"chartist-plugin-tooltips-updated": "^0.0.20",
"classnames": "^2.2.6",
"connected-react-router": "^6.3.1",
"d3-dsv": "^1.1.1",
"d3-format": "^1.3.2",
"d3-time-format": "^2.1.3",
"drizzle": "^1.4.0",
"enquire-js": "^0.2.1",
"history": "^4.7.2",
"lodash": "^4.17.11",
"moment": "^2.24.0",
"nprogress": "^0.2.0",
"peity-react": "^0.0.7",
"prop-types": "^15.7.1",
"qrcode.react": "^0.9.3",
"qs": "^6.6.0",
"rc-drawer": "^1.7.7",
"react": "^16.8.1",
"react-c3js": "^0.1.20",
"react-chartist": "^0.13.3",
"react-chartjs-2": "^2.7.4",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "^16.8.1",
"react-draft-wysiwyg": "^1.13.1",
"react-helmet": "^5.2.0",
"react-intl": "^2.8.0",
"react-loadable": "^5.5.0",
"react-redux": "^6.0.0",
"react-redux-spinner": "^2.0.0",
"react-router": "^4.3",
"react-router-dom": "^4.3.1",
"react-router-redux": "^4.0.8",
"react-scripts": "2.1.5",
"react-stockcharts": "^0.7.8",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-saga": "^1.0.1",
"redux-thunk": "^2.3.0",
"store": "^2.0.12",
"web3": "^1.0.0-beta.55"
},
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.3.0",
"babel-plugin-import": "^1.11.0",
"customize-cra": "^0.2.11",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.0.0",
"husky": "^1.3.1",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"lint-staged": "^8.1.3",
"node-sass": "^4.11.0",
"react-app-rewired": "^2.1.0",
"stylelint": "^9.10.1",
"stylelint-config-prettier": "^4.0.0",
"stylelint-config-standard": "^18.2.0"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
Note: Never experienced this error before and I have used Husky a bunch before; it just pop randomly. |
Update to latest git version can resolve this issue. |
Problem persists:
|
This is bug with lint-staged. you can npm install lint-staged@8.1.7 solve this problem |
Associate issue lint-staged/lint-staged#627 |
@AlfredMou That solved the issue, thanks! |
@AlfredMou thanks! That fixed the issue. For future readers, this is an issue with version |
Ok, that fixed it for me as well, but I had to update my git version as well. Thanks for the help @AlfredMou |
Every time I try to commit with husky I get this error
This error is happening only when husky is activated.
I have used husky before and I never had this error.
my
package.json
OS: Ubuntu 18.04.2 LTS
Node 11.15.0
Git: 2.17.1
The text was updated successfully, but these errors were encountered: