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

Add missing supports-color dependency #349

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

erunion
Copy link
Contributor

@erunion erunion commented Jul 19, 2024

👋 Our package-lock.json file is a mess for a variety of reasons I won't bore you with but while removing an ancient version of webpack-dev-server that used supports-color from our application it ended up deleting node_modules/supports-color; however because Alex has an implicit dependency on this by way of vfile-reporter it left node_modules/vfile-reporter/node_modules/supports-color alone.

Unfortunately because this is an implicit and not an explicit dependency Alex began to throw the following error for us:

node:internal/modules/esm/resolve:853
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
        ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'supports-color' imported from /Users/erunion/redacted/path/to/codebase/node_modules/alex/cli.js
    at packageResolve (node:internal/modules/esm/resolve:853:9)
    at moduleResolve (node:internal/modules/esm/resolve:910:20)
    at defaultResolve (node:internal/modules/esm/resolve:1130:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v20.11.1

Installing supports-color as a development dependency of our application places supports-color back into the root node_modules directory and makes Alex work again.

Because Alex directly depends on this module it should list it as an explicit dependency.

@wooorm wooorm merged commit 8f9af43 into get-alex:main Jul 19, 2024
0 of 2 checks passed
@wooorm wooorm changed the title fix: adding missing supports-color dependency Add missing supports-color dependency Jul 19, 2024
@wooorm
Copy link
Member

wooorm commented Jul 19, 2024

Thanks! :)

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

Successfully merging this pull request may close these issues.

2 participants