pascalroget / whatsgpt

WhatsApp Bot for ChatGPT with multiple user support
MIT License
91 stars 32 forks source link

Type : Module #6

Open DxDek opened 1 year ago

DxDek commented 1 year ago

Hello Pascal, I have the problem that then i want to run the script i get this error : ReferenceError: require is not defined in ES module scope, you can use import instead This file is being treated as an ES module because it has a '.js' file extension and 'C:\Users\DxDek\Documents\whatsgpt-main\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension. at file:///C:/Users/DxDek/Documents/whatsgpt-main/index.js:9:1 at ModuleJob.run (node:internal/modules/esm/module_job:193:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:530:24) at async loadESM (node:internal/process/esm_loader:91:5) at async handleMainPromise (node:internal/modules/run_main:65:12)

and if i change it to Type = commonjs the terminal want that i change it to = module

Dear 
DxDek