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

Added string-width to dependencies #228

Merged

Conversation

ellingtonc
Copy link
Contributor

Problem

[email protected] uses the string-width package, but doesn't include it as a dependency or peer-dependency.

Implication

Users that install & import the latest version of ora for the first time will run into the following runtime error if string-width isn't specifically listed as a dependency or required by any other dependencies.

node:internal/modules/cjs/loader:1077
const err = new Error(message);
            ^
Error: Cannot find module 'string-width'
...

This error is caused by Line 7 in node_modules/ora/index.js

import stringWidth from "string-width";

Solution

Add string-width as a dependency or peer-dependency in ora's package.json.

{
  "name": "ora",
  ...
  "dependencies": {
    ...
    "string-width": "^6.1.0"
  }
}

Problem & Solution Tested On

  • Mac OS X Ventura
  • Debian Linux 12 Bookworm
  • Node v18.7.0
  • Node v20.5.0

Last Working Version

  • The previous release ([email protected]) works as expected as it doesn't depend on or import the string-width package.

@sindresorhus sindresorhus merged commit 1dc1ece into sindresorhus:main Aug 1, 2023
3 checks passed
@sindresorhus
Copy link
Owner

Thanks :)

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

Successfully merging this pull request may close these issues.

2 participants