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

Error: Cannot find module #784

Open
skwde opened this issue Apr 10, 2024 · 3 comments
Open

Error: Cannot find module #784

skwde opened this issue Apr 10, 2024 · 3 comments

Comments

@skwde
Copy link

skwde commented Apr 10, 2024

Something similar is already mentioned here #744 / #750.

I now have commitlint installed via a conda installed node (inside a container). I can use it without issues on the command line.

Following modules are installed

(base) root@213d29790eb9:/workspaces/docs# npm list -g
/opt/conda/lib
├── @commitlint/[email protected]
├── @commitlint/[email protected]
├── [email protected]
└── [email protected]

I have following commitlint.config.js in my project directory:

module.exports = {
    extends: ['@commitlint/config-conventional'],
};

and following commitlint related VSCode settings

    "commitlint.log.enabled": true,
    "commitlint.globalLibraryPath": "/opt/conda/lib",
    "commitlint.globalNodePath": "/opt/conda/bin/node",

playing with globalLibraryPath or setting preferBundledLibraries to true does not help and lead to the same problem.

@joshbolduc
Copy link
Owner

There may be multiple factors at play here, but I'd bet #753 is at least partly to blame. You could give 18.x a try in the meantime and see if that works.

@skwde
Copy link
Author

skwde commented Apr 11, 2024

Using @commitlint/config-conventional@18, i.e.

/opt/conda/lib
├── @commitlint/[email protected]
├── @commitlint/[email protected]
├── [email protected]
└── [email protected]

as you suggested indeed works, even without setting the path explicitly.

Note, when installing the package better reload the VSCode window.

@joshbolduc
Copy link
Owner

Reopening since #753 didn't fix this per @skwde:

@joshbolduc, I hate to bring the bad news, but it still seems broken for v19. #784 still doesn't work with extension version 2.6.0

# npm list -g
/opt/conda/lib
├── @commitlint/[email protected]
├── @commitlint/[email protected]

And the extension output:

loading @commitlint/parse dynamically via /opt/conda/lib/node_modules/@commitlint/cli/node_modules/@commitlint/parse/lib/index.js
loading @commitlint/load dynamically via /opt/conda/lib/node_modules/@commitlint/cli/node_modules/@commitlint/load/lib/load.js
loading @commitlint/lint dynamically via /opt/conda/lib/node_modules/@commitlint/cli/node_modules/@commitlint/lint/lib/lint.js
Load config error stack:
Error: Cannot find module "@commitlint/config-conventional" from "/workspaces/docs"

The downgrade to v18.6.3 still works.

I haven't had a chance to investigate further and see what might have changed here in v19.

@joshbolduc joshbolduc reopened this Apr 25, 2024
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

2 participants