question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not work after npm i and package config

See original GitHub issue

Hi!

TLDR; IRFM, ran it, then tried to run git cz, it failed with an unfortunate but epic error,

D:\work\MyBlog\C\c2-bin>git cz
module.js:338
    throw err;
          ^
Error: Cannot find module 'D:\work\MyBlog\C\c2-bin\node_modules\commitizen\bin\git-cz'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

The longer story

Running windows 7 with node and npm such

D:\work\MyBlog\C\c2-bin>npm -v
2.11.3

D:\work\MyBlog\C\c2-bin>node -v
v0.12.7

I have run D:\work\MyBlog\C\c2-bin>npm install -g commitizen, then D:\work\MyBlog\C\c2-bin>commitizen init cz-conventional-changelog --save --save-exact

Then i configured my local package.json file to add

  ,"config": {
    "commitizen": {
      "path": "node_modules/cz-conventional-changelog"
    }
  }

Where did i get it wrong ?

Thanks !


D:\work\MyBlog\C\c2-bin>commitizen init cz-conventional-changelog --save --save-exact
Attempting to initialize using the npm package cz-conventional-changelog
Error: A previous adapter is already configured. Use --force to override

D:\work\MyBlog\C\c2-bin>commitizen init cz-conventional-changelog --save --save-exact --force
Attempting to initialize using the npm package cz-conventional-changelog
npm WARN using --force I sure hope you know what you are doing.
npm WARN package.json c2-bin@1.0.0 No repository field.
npm WARN package.json c2-bin@1.0.0 license should be a valid SPDX license expression
cz-conventional-changelog@1.1.4 node_modules\cz-conventional-changelog
└── word-wrap@1.1.0
{this.config was unexpected at this time.

D:\work\MyBlog\C\c2-bin>  "C:\Users\d1m\AppData\Roaming\npm\node_modules\commitizen\node_modules\.bin\\node.exe"  "C:\Users\d1m\AppData\Roaming\npm\node_modules\commitizen\node
_modules\.bin\\..\json\lib\json.js" -I -f D:\work\MyBlog\C\c2-bin\package.json -e 'if(!this.config) {this.config={};}; if(!this.config.commitizen) { this.config.commitizen={};}
; this.config.commitizen.path="./node_modules/cz-conventional-changelog"'

D:\work\MyBlog\C\c2-bin>git cz
module.js:338
    throw err;
          ^
Error: Cannot find module 'D:\work\MyBlog\C\c2-bin\node_modules\commitizen\bin\git-cz'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

D:\work\MyBlog\C\c2-bin>

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:29 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
maboiteaspamcommented, Nov 18, 2015

Hi @jimthedev ,

amazing, i can make it work now : ) Happy.

But i need to report about something i found weird.

git cz will not work, git-cz does work here.

The steps i followed

npm rm babel-cli babel -g # just in case
npm i commitizen@latest -g --force 
npm ls commitizen -g --depth=1 # to check
commitizen init cz-conventional-changelog --save --save-exact --force

et voila : )

Will dig about adapters now !!

Thanks again.

0reactions
maboiteaspamcommented, Dec 31, 2015

kind of forgotten to close, sorry : )

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm config set command not working properly - Stack Overflow
i set the default config for the package.
Read more >
Common errors | npm Docs
Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later. This can be caused by...
Read more >
[BUG] Overrides are not updating after running npm install
I'm seeing this issue on 8.5.5 currently; removing node_modules and package-lock.json and doing npm install does install the overridden ...
Read more >
Manage npm packages - Visual Studio (Windows)
Visual Studio helps you to manage packages using the Node.js package ... For help resolving issues with npm packages, see Troubleshooting.
Read more >
npm packages in the Package Registry - GitLab Docs
When an npm package is not found in the Package Registry, the request is ... If you get this error, one of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found