whatsapp-chatgpt
whatsapp-chatgpt copied to clipboard
Fail to run "npm run start"
I got the error below, anyone can help?
[email protected] start C:\Users\kuang\Desktop\WhatsApp_ChatGPT npx vite-node src/index.ts
npm WARN config cache-max This option has been deprecated in favor of --prefer-online
npm WARN config cache-min This option has been deprecated in favor of --prefer-offline
.
npm WARN config optional Use --omit=optional
to exclude optional dependencies, or
npm WARN config --include=optional
to include them.
npm WARN config
npm WARN config Default value does install optional deps unless otherwise omitted.
npm WARN config shrinkwrap Use the --package-lock setting instead.
npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
npm WARN config location in the cache, and they are managed by
npm WARN config cacache
.
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Files\nodejs\node_cache_npx\12112" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Program Files\nodejs\node_cache_logs\2023-02-08T15_47_41_230Z-debug.log
Install for [ 'vite-node@latest' ] failed with code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: npx vite-node src/index.ts
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Program Files\nodejs\node_cache_logs\2023-02-08T15_47_41_327Z-debug.log
Did you run npm install
before npm run start
?
Tried to install vite-node, but failed with this command - npm install vite-node
@sharp0111 could you provide what npm
logs when you run npm install
?
from OP message npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
it seems to be happened due to a network problem.
➜ whatsapp-chatgpt git:(master) npm run start
[email protected] start npx vite-node src/index.ts
file://whatsapp-chatgpt/node_modules/chatgpt/build/index.js:132 throw new Error("Invalid environment; fetch is not defined");
➜ whatsapp-chatgpt git:(master) npm run start
[email protected] start npx vite-node src/index.ts
file://whatsapp-chatgpt/node_modules/chatgpt/build/index.js:132 throw new Error("Invalid environment; fetch is not defined");
Whats your node version?
If fetch is not defined, its mostly because you're using node <= v18
I use node v16. I'll try a later version. Thanks.
Thank you, with 18+ it will work for sure :)