Skip to content
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

Git bash on windows: cannot read property 'get' of undefined #559

Open
MartinMuzatko opened this issue Aug 31, 2018 · 4 comments
Open

Git bash on windows: cannot read property 'get' of undefined #559

MartinMuzatko opened this issue Aug 31, 2018 · 4 comments

Comments

@MartinMuzatko
Copy link

Currently I get this error when running git-cz on a windows system:

Martin Muzatko@martin MINGW64 ~/dev/bitbucket/sicon (docker)
$ npx git-cz
Error: EPERM: operation not permitted, mkdir 'C:\Users\Martin'
TypeError: Cannot read property 'get' of undefined
    at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
    at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:83:20
    at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:224:22)
    at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:262:24
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:81:7
    at Array.forEach (<anonymous>)
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:80:13
    at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
    at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:178:20)
    at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53
    at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
    at FSReqWrap.oncomplete (fs.js:170:21)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205
  if (npm.config.get('json')) {
                 ^

TypeError: Cannot read property 'get' of undefined
    at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
    at process.emit (events.js:180:13)
    at process._fatalException (bootstrap_node.js:431:27)
Install for prefix@latest failed with code 7
C:\Users\Martin Muzatko\AppData\Roaming\npm\node_modules\git-cz\bin\git-cz.js
The system cannot find the path specified.
×  fatal                        Error: Could not find Git root folder.
    at createState (C:\Users\Martin Muzatko\AppData\Roaming\npm\node_modules\git-cz\dist\cli.js:202:11)
    at main (C:\Users\Martin Muzatko\AppData\Roaming\npm\node_modules\git-cz\dist\cli.js:105:19)
    at Object.2../createState (C:\Users\Martin Muzatko\AppData\Roaming\npm\node_modules\git-cz\dist\cli.js:158:1)
    at o (C:\Users\Martin Muzatko\AppData\Roaming\npm\node_modules\git-cz\dist\cli.js:1:327)
    at r (C:\Users\Martin Muzatko\AppData\Roaming\npm\node_modules\git-cz\dist\cli.js:1:493)
    at Object.<anonymous> (C:\Users\Martin Muzatko\AppData\Roaming\npm\node_modules\git-cz\dist\cli.js:1:522)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)

@MartinMuzatko
Copy link
Author

the problem is that the path is cut off at the space. the path should be "Martin Muzatko" instead

@dmcclurealinta
Copy link

Getting the same issue here, but there is no space in our paths, this is running on windows with gitbash as the shell, WSL on the other hand is fine.

$ git-cz
The system cannot find the path specified.
×  fatal     Error: Could not find Git root folder.
    at createState (C:\work\GITHUBPROJECT\node_modules\git-cz\dist\cli.js:202:11)
    at main (C:\work\GITHUBPROJECT\node_modules\git-cz\dist\cli.js:105:19)
    at Object.2../createState (C:\work\GITHUBPROJECT\node_modules\git-cz\dist\cli.js:158:1)
    at o (C:\work\GITHUBPROJECT\node_modules\git-cz\dist\cli.js:1:327)
    at r (C:\work\GITHUBPROJECT\node_modules\git-cz\dist\cli.js:1:493)
    at Object.<anonymous> (C:\work\GITHUBPROJECT\node_modules\git-cz\dist\cli.js:1:522)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)

@jimthedev
Copy link
Member

I don't have this environment available to me but would love a PR if anyone has time to look into it.

@bechar-ce
Copy link

May be below steps help you out for the issue...
clean cache with
npm cache clean --force
install the latest version of npm globally as admin:

npm install -g npm@latest --force
clean cache with

npm cache clean --force
Try to install your component once again.

After the above steps, you follow. Please fire the below commands.
commitizen init cz-conventional-changelog --save-dev --save-exact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants