askrella / whatsapp-chatgpt

ChatGPT + DALL-E + WhatsApp = AI Assistant :rocket: :robot:
3.49k stars 842 forks source link

Error: Parse failure: Octal literal in strict mode (3:13) #245

Closed helviodarochalima closed 1 year ago

helviodarochalima commented 1 year ago

Hi there,

follow the error after installing whatsapp-chatgpt - ubuntu 22..04 -

Does anybody help me?

Thanks

ubuntu@ip-172-31-8-253:~/projeto/whatsapp-chatgpt$ npm run start

whatsapp-chatgpt@1.0.0 start npx vite-node src/index.ts

Need to install the following packages: vite-node@0.31.2 Ok to proceed? (y) y file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53776 throw new Error(Parse failure: ${err.message}\nAt file: ${url}\nContents of line ${line}: ${code.split('\n')[line - 1]}); ^

Error: Parse failure: Octal literal in strict mode (3:13) At file: /home/ubuntu/projeto/whatsapp-chatgpt/node_modules/qrcode-terminal/lib/main.js Contents of line 3: black = "\033[40m \033[0m", at ssrTransformScript (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53776:15) at ssrTransform (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53751:12) at Object.ssrTransform (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:63307:20) at loadAndTransform (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53422:24)

Node.js v20.2.0

helviodarochalima commented 1 year ago

Folow th fix commands :

nano /home/ubuntu/projeto/whatsapp-chatgpt/node_modules/qrcode-terminal/lib/main.js change line 3 "black = "\033[40m \033[0m", to "black = "\u001b[40m \u001b[0m",

chane line 5 "white = "\033[47m \033[0m", to white = "\u001b[47m \u001b[0m",

ialexsilva commented 1 year ago

vite-node updated today and broken qr-code-terminal

to simple fix this go to your package.json and change your start script:

From: "start": "npx vite-node src/index.ts", To: "start": "npx vite-node@0.31.1 src/index.ts",

helviodarochalima commented 1 year ago

ok thanks