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

npx taze@latest throws [ERR_MODULE_NOT_FOUND] #111

Closed
5 tasks done
jj-ivx opened this issue Apr 16, 2024 · 3 comments
Closed
5 tasks done

npx taze@latest throws [ERR_MODULE_NOT_FOUND] #111

jj-ivx opened this issue Apr 16, 2024 · 3 comments

Comments

@jj-ivx
Copy link

jj-ivx commented Apr 16, 2024

Describe the bug

After the latest release I get the following error when running npx taze@latest:

 ERROR

> @changesets/cli unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> concurrently unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> eslint unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> eslint-plugin-workspaces unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> husky unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> lint-staged unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> playwright unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> prettier unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> turbo unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> typescript unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?
> pnpm unknown error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/user/.npm/_npx/8fc85ace19384184/node_modules/semver/functions/valid' imported from /Users/user/.npm/_npx/8fc85ace19384184/node_modules/taze/dist/chunks/index.mjs
Did you mean to import "semver/functions/valid.js"?

Reproduction

Run npx taze@latest

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1
    Memory: 136.84 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.asdf/installs/nodejs/20.12.2/bin/node
    npm: 10.5.0 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 8.15.7 - ~/.asdf/installs/nodejs/20.12.2/bin/pnpm
  Browsers:
    Chrome: 123.0.6312.124
    Safari: 17.4.1

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@antfu
Copy link
Member

antfu commented Apr 16, 2024

/cc @SukkaW 👀

@SukkaW
Copy link
Contributor

SukkaW commented Apr 16, 2024

I will take a look immediately!


Update

image

A test case has been created.


Update

I am able to pinpoint that the issue is caused by this line:

https://github.com/antfu/taze/blob/6a15bcc3ea239612c787ab1cc1ace0178e62be32/src/utils/npm.ts#L8


Update

The issue is caused by unbuild (it uses rollup under the hood) incorrectly bundling @npmcli/config and its transitive dependency cacache (which requires its own package.json).

@SukkaW
Copy link
Contributor

SukkaW commented Apr 16, 2024

Update

I've created #112 to fix the issue. You can also find the background and the context of the issue there.

@antfu antfu closed this as completed in ed12bc6 Apr 16, 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

3 participants