Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
require works but import does not work in node js version 14+

everything works very fine in the localhost with the node 14.

But when i try to host it to the cpanel using es6 import, it fails and gives the error like,

RangeError: WebAssembly.instantiate(): Out of memory: wasm memory
    at internal/deps/cjs-module-lexer/dist/lexer.js:1:33272
    at async initCJSParse (internal/modules/esm/translators.js:67:5)
    at async Loader.commonjsStrategy (internal/modules/esm/translators.js:181:18)

It is very weird.

package.json file

{
  "name": "practice",
  "version": "1.0.0",
  "description": "",
  "type":"module",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "run": "node index.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1"
  }
}

index.js file

import express from "express";
const app = express();
const port = 3000;

app.get("/", (req, res) => {
  res.send("Hello World test2");
});

app.listen();

debug log enter image description here need some help hosting my nodejs app to cpanel

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!