lwsjs / local-web-server

A lean, modular web server for rapid full-stack development.
MIT License
1.2k stars 85 forks source link

Nodejs version not compatible: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: #169

Closed christianxiao closed 2 years ago

christianxiao commented 2 years ago

When my nodejs version is v12.16.2, I got this error when run ws: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /my-project-path/node_modules/local-web-server/bin/cli.mjs I can fix this problem by upgrading my node version to v14, but on other machines they can't upgrade node version, so how can we make ws work on node v12? Thank you for your contribution to this project !

75lb commented 2 years ago

Hi, the current version requires node v12.20 or above.. Please use local-web-server version 4 on your other machines until you can upgrade to node v12.20 or above..

npm install local-web-server@^4