zeke / california-license-plates

A silly tool to search the California DMV website for available custom license plate names.
16 stars 5 forks source link

Cannot find module 'chalk' #1

Closed alberttwong closed 2 months ago

alberttwong commented 2 months ago
albert@albertonehouse california-license-plates % brew install npm
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Auto-updated Homebrew!
Updated 3 taps (hashicorp/tap, homebrew/core and homebrew/cask).
==> New Formulae
ktor
==> New Casks
parallels@19                             zen-browser

You have 4 outdated formulae installed.

==> Downloading https://ghcr.io/v2/homebrew/core/node/manifests/22.8.0
######################################################################### 100.0%
==> Fetching dependencies for node: c-ares and libuv
==> Downloading https://ghcr.io/v2/homebrew/core/c-ares/manifests/1.33.1
######################################################################### 100.0%
==> Fetching c-ares
==> Downloading https://ghcr.io/v2/homebrew/core/c-ares/blobs/sha256:1db3cc921cd
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libuv/manifests/1.48.0
######################################################################### 100.0%
==> Fetching libuv
==> Downloading https://ghcr.io/v2/homebrew/core/libuv/blobs/sha256:803e5cefd252
######################################################################### 100.0%
==> Fetching node
==> Downloading https://ghcr.io/v2/homebrew/core/node/blobs/sha256:82e1cf65b77d6
######################################################################### 100.0%
==> Installing dependencies for node: c-ares and libuv
==> Installing node dependency: c-ares
==> Downloading https://ghcr.io/v2/homebrew/core/c-ares/manifests/1.33.1
Already downloaded: /Users/albert/Library/Caches/Homebrew/downloads/f0fa4c33dac70b049bafa256c628799688ab0940d9d15317846a9586f9bf2e7e--c-ares-1.33.1.bottle_manifest.json
==> Pouring c-ares--1.33.1.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/c-ares/1.33.1: 170 files, 923.6KB
==> Installing node dependency: libuv
==> Downloading https://ghcr.io/v2/homebrew/core/libuv/manifests/1.48.0
Already downloaded: /Users/albert/Library/Caches/Homebrew/downloads/8ee1d27fb604f55e3c4415b96e34dc9c7f557996832c372d984c8162b29a4ad2--libuv-1.48.0.bottle_manifest.json
==> Pouring libuv--1.48.0.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/libuv/1.48.0: 20 files, 1.1MB
==> Installing node
==> Pouring node--22.8.0.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/node/22.8.0: 2,058 files, 79.6MB
==> Running `brew cleanup node`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
albert@albertonehouse california-license-plates %
albert@albertonehouse california-license-plates % npm i -g california-license-plates

npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported

added 263 packages in 6s

86 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New patch version of npm available! 10.8.2 -> 10.8.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3
npm notice To update run: npm install -g npm@10.8.3
npm notice
albert@albertonehouse california-license-plates %
albert@albertonehouse california-license-plates % npx california-license-plates dohardthg
node:internal/modules/cjs/loader:1251
  throw err;
  ^

Error: Cannot find module 'chalk'
Require stack:
- /Users/albert/sandbox/california-license-plates/cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/Users/albert/sandbox/california-license-plates/cli.js:4:15)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/albert/sandbox/california-license-plates/cli.js' ]
}

Node.js v22.8.0
alberttwong commented 2 months ago
albert@albertonehouse california-license-plates % npm install chalk
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

added 263 packages, and audited 264 packages in 3s

87 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
albert@albertonehouse california-license-plates % npx california-license-plates dohardthg
/Users/albert/sandbox/california-license-plates/cli.js:315
undefined
             ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/albert/sandbox/california-license-plates/node_modules/chalk/source/index.js from /Users/albert/sandbox/california-license-plates/cli.js not supported.
Instead change the require of index.js in /Users/albert/sandbox/california-license-plates/cli.js to a dynamic import() which is available in all CommonJS modules.
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at Object.<anonymous> (/Users/albert/sandbox/california-license-plates/cli.js:4:15) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v22.8.0
alberttwong commented 2 months ago
albert@albertonehouse california-license-plates % npm uninstall chalk

removed 1 package, and audited 264 packages in 569ms

86 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
albert@albertonehouse california-license-plates % npm i chalk@4.1.2

added 3 packages, removed 3 packages, and audited 264 packages in 566ms

86 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
alberttwong commented 2 months ago

https://github.com/zeke/california-license-plates/pull/4