askrella / whatsapp-chatgpt

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

Error when "npm run start" #337

Open sitxxar opened 7 months ago

sitxxar commented 7 months ago

Screenshot 2024-04-20 223721

MikelCalvo commented 4 months ago

Hi, should be working now with the latest changes, let me know if you face any problems.

pixilated730 commented 3 months ago

facing this error

npm install npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated puppeteer@18.2.1: < 22.8.2 is no longer supported

added 369 packages, and audited 370 packages in 2m

54 packages are looking for funding run npm fund for details

4 high severity vulnerabilities

To address all issues, run: npm audit fix

Run npm audit for details.

npm run start

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

5:38:37 PM [vite] Pre-transform error: Missing "./llms/openai" specifier in "langchain" package (node:1486959) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode on September 8, 2024 and reach end-of-support on September 8, 2025.

Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check blog post at https://a.co/cUPnyil (Use node --trace-warnings ... to show where the warning was created) file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:45942 function e(e,n,r){throw new Error(r?No known conditions for "${n}" specifier in "${e}" package:Missing "${n}" specifier in "${e}" package)}function n(n,i,o,f){let s,u,l=r(n,o),c=function(e){let n=new Set(["default",...e.conditions||[]]);return e.unsafe||n.add(e.require?"require":"import"),e.unsafe||n.add(e.browser?"browser":"node"),n}(f||{}),a=i[l];if(void 0===a){let e,n,r,t;for(t in i)n&&t.length<n.length||("/"===t[t.length-1]&&l.startsWith(t)?(u=l.substring(t.length),n=t):t.length>1&&(r=t.indexOf("",1),~r&&(e=RegExp("^"+t.substring(0,r)+"(.)"+t.substring(1+r)).exec(l),e&&e[1]&&(u=e[1],n=t))));a=i[n];}return a||e(n,l),s=t(a,c),s||e(n,l,1),u&&function(e,n){let r,t=0,i=e.length,o=/[*]/g,f=/[/]$/;for(;t<i;t++)e[t]=o.test(r=e[t])?r.replace(o,n):f.test(r)?r+n:r;}(s,u),s}function r(e,n,r){if(e===n||"."===n)return ".";let t=e+"/",i=t.length,o=n.slice(0,i)===t,f=o?n.slice(i):n;return "#"===f[0]?f:o||!r?"./"===f.slice(0,2)?f:"./"+f:f}function t(e,n,r){if(e){if("string"==typeof e)return r&&r.add(e),[e];let i,o;if(Array.isArray(e)){for(o=r||new Set,i=0;i<e.length;i++)t(e[i],n,o);if(!r&&o.size)return [...o]}else for(i in e)if(n.has(i))return t(e[i],n,r)}}function o(e,r,t){let i,o=e.exports;if(o){if("string"==typeof o)o={".":o};else for(i in o){"."!==i[0]&&(o={".":o});break}return n(e.name,o,r||".",t)}}function f(e,r,t){if(e.imports)return n(e.name,e.imports,r,t)} ^

Error: Missing "./llms/openai" specifier in "langchain" package at e (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:45942:25) at n (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:45942:627) at o (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:45942:1297) at resolveExportsOrImports (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:46563:18) at resolveDeepImport (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:46586:25) at tryNodeResolve (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:46351:16) at ResolveIdContext.resolveId (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:46101:19) at PluginContainer.resolveId (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:48893:17) at processTicksAndRejections (node:internal/process/task_queues:95:5) at TransformPluginContext.resolve (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:49053:15) at normalizeUrl (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:63903:26) at file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:64042:39 at async Promise.all (index 0) at TransformPluginContext.transform (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:63969:7) at PluginContainer.transform (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:48974:18) at loadAndTransform (file:///home/ubuntu/.npm/_npx/f2342a4b64a2bc92/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:51796:27) { plugin: 'vite:import-analysis', id: '/home/ubuntu/bot/wapp/whatsapp-chatgpt/src/providers/browser-agent.ts', pluginCode: 'import { OpenAI } from "langchain/llms/openai";\n' + 'import { SerpAPI } from "langchain/tools";\n' + 'import { initializeAgentExecutor } from "langchain/agents";\n' + 'export default class BrowserAgentProvider {\n' + ' constructor() {\n' + ' // Can use other browser tools like RequestGetTool if you do not have a SerpAPI API key.\n' + ' this.tools = [\n' + ' new SerpAPI()\n' + ' // new RequestsGetTool(),\n' + ' ];\n' + ' // Always select highest probability word in search\n' + ' this.model = new OpenAI({ temperature: 0 });\n' + ' this.fetch = async (query) => {\n' + ' const executor = await initializeAgentExecutor(this.tools, this.model, "zero-shot-react-description", true);\n' + ' const result = await executor.call({ input: query });\n' + ' return result.output;\n' + ' };\n' + ' }\n' + '}\n' }