Skip to content

Cannot find module 'conventional-commits-parser' #3049

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

Closed
1 of 4 tasks
seedy opened this issue Feb 25, 2022 · 4 comments
Closed
1 of 4 tasks

Cannot find module 'conventional-commits-parser' #3049

seedy opened this issue Feb 25, 2022 · 4 comments

Comments

@seedy
Copy link

seedy commented Feb 25, 2022

Expected Behavior

Classic output. Your README doesn't mention the package is needed to run the tool.

Current Behavior

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'conventional-commits-parser'
Require stack:
- /node_modules/@commitlint/parse/lib/index.js
- /node_modules/@commitlint/lint/lib/lint.js
- /node_modules/@commitlint/cli/lib/cli.js
- /node_modules/@commitlint/cli/cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/seedy/workspace/faency/node_modules/@commitlint/parse/lib/index.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
}

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

  1. npm install --save-dev @commitlint/config-conventional @commitlint/cli
  2. running a package script internally running commitlint --version

Context

Running commitlint

Configuration

package.json

  "commitlint": {
    "extends": ["@commitlint/config-conventional"]
  },

Your Environment

Executable Version
commitlint --version 16.2.1
@commitlint/cli 16.2.1
@commitlint/config-conventional 16.2.1
git --version 2.25.1
node --version 16.11.1
@escapedcat
Copy link
Member

escapedcat commented Feb 27, 2022

Can you reproduce this locally? I can't.
Does it only happen in your CI env? Maybe you're missing something there?
Might relate to #586

You can also try to use one of the GH actions commitlint actions available. Try googling those.

@seedy
Copy link
Author

seedy commented Feb 28, 2022

@escapedcat I reproduce locally, yes.

As you can see from my report, the issue happens right during loading of the cli.

I am not even linting any commit, simply trying to get commitlint --version to run triggers the error.

You got it right, I'm looking into a GH action, therefore I'll go after an existing package for now.

@escapedcat
Copy link
Member

Hm, would you mind creating a repo with steps to reproduce this? As I said, I can't reproduce this locally.

@seedy
Copy link
Author

seedy commented Feb 28, 2022

@escapedcat Clearing my repo and installing again, I no longer have the issue.

I suppose I had some setup clashing.

Closing as I can't reproduce previous issue with a clean repo + am going to use an existing GH action.

Thanks for your time, sorry for bothering there 😅

@seedy seedy closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants