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 'C:\C:\Users\...\node_modules\jwt-cracker\process-chunk.js' #25

Closed
lmammino opened this issue Jan 25, 2023 · 1 comment · Fixed by #26
Closed

Comments

@lmammino
Copy link
Owner

Double C:\ apprearing at the beginning of the path on Windows

Reported in #21

@lmammino
Copy link
Owner Author

This happens because we are currently using:

const __dirname = new URL('.', import.meta.url).pathname

This produces the following on Windows: /C:/Users/luciano/Desktop/stuff/ while we want C:\Users\luciano\Desktop\stuff\

The correct way of doing this is:

import { fileURLToPath } from 'node:url'

const __dirname = fileURLToPath(new URL('.', import.meta.url))

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 a pull request may close this issue.

1 participant