Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when "npm run start" #337

Open
sitxxar opened this issue Apr 20, 2024 · 2 comments
Open

Error when "npm run start" #337

sitxxar opened this issue Apr 20, 2024 · 2 comments

Comments

@sitxxar
Copy link

sitxxar commented Apr 20, 2024

Screenshot 2024-04-20 223721

@MikelCalvo
Copy link
Collaborator

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

@pixilated730
Copy link

pixilated730 commented Aug 9, 2024

facing this error

npm install
npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: < 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

[email protected] 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'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants