How to set the environment as node.js?
Hi all, I’m pretty sure I selected the environment as nodejs when I created the file. But it still gives SyntaxError. The AI answered below.
The error in your project is in the file index.js on line 2. This error occurs because you are trying to use ES6 import statements to import modules, which may not be fully supported in the current Node.js environment. To fix this, you should consider using a tool like Babel to transpile your ES6 code to CommonJS, which is natively supported by Node.js.
Replit Profile: https://replit.com/@aliattaran