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 './uws_linux_x64_93.node' #2846

Closed
atshushi opened this issue Jan 19, 2023 · 4 comments
Closed

Error: Cannot find module './uws_linux_x64_93.node' #2846

atshushi opened this issue Jan 19, 2023 · 4 comments

Comments

@atshushi
Copy link

Error: This version of uWS.js supports only Node.js 16 and 18, and 19 on (glibc) Linux, macOS and Windows, on Tier 1 platforms (https://github.com/nodejs/node/blob/master/BUILDING.md#platform-list).        

Error: Cannot find module './uws_linux_x64_93.node'
const { buildSync } = require('esbuild');
const process = require('process');
const glob = require('glob');


buildSync({
  entryPoints: glob.sync(`${process.argv.pop()}/**/**`)
    .filter((path) => path.endsWith('.ts')),
  platform: 'node',
  bundle: true,
  minify: true,
  outdir: 'dist',
  format: 'esm',
  loader: {
    '.html': 'text',
    '.css': 'text',
  },
});

node -v: v16.19.0

@atshushi
Copy link
Author

atshushi commented Jan 19, 2023

the problem is in the import, not in the uws

@evanw
Copy link
Owner

evanw commented Jan 19, 2023

https://esbuild.github.io/getting-started/#bundling-for-node

You also may not want to bundle your dependencies with esbuild. There are many node-specific features that esbuild doesn't support while bundling such as __dirname, import.meta.url, fs.readFileSync, and *.node native binary modules. You can exclude all of your dependencies from the bundle by setting packages to external:

  packages: 'external',

If you do this, your dependencies must still be present on the file system at run-time since they are no longer included in the bundle.

@atshushi
Copy link
Author

finally it worked, thanks for the quick reply

@evanw
Copy link
Owner

evanw commented Jan 19, 2023

I'm closing this issue as it's a question, not a bug report, and the answer is already on the first page of the docs.

@evanw evanw closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2023
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

2 participants