You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in commonjs environment,call langchain like below:
const {
OpenAI,
OpenAIChat
} = require("langchain/llms/openai");
#################################
Unexpected token export\n/var/user/node_modules/langchain/llms/openai.js:1\n(function (exports, require, module, __filename, __dirname) { export * from '../dist/llms/openai.js'\n ^^^^^^\n\nSyntaxError: Unexpected token export\n at createScript (vm.js:80:10)\n at Object.runInThisContext (vm.js:139:10)\n at Module._compile (module.js:607:28)\n at Object.Module._extensions..js (module.js:654:10)\n at Module.load (module.js:556:32)\n at tryModuleLoad (module.js:499:12)\n at Function.Module._load (module.js:491:3)\n at Module.require (module.js:587:17)\n at require (internal/module.js:11:18)\n
The text was updated successfully, but these errors were encountered:
dosubotbot
added
the
auto:bug
Related to a bug, vulnerability, unexpected error with an existing feature
label
Jul 12, 2023
The suggested solution is: Move the LangChain dependency from the devDependencies list to the dependencies list in your package.json file.
This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
in commonjs environment,call langchain like below:
const {
OpenAI,
OpenAIChat
} = require("langchain/llms/openai");
#################################
Unexpected token export\n/var/user/node_modules/langchain/llms/openai.js:1\n(function (exports, require, module, __filename, __dirname) { export * from '../dist/llms/openai.js'\n ^^^^^^\n\nSyntaxError: Unexpected token export\n at createScript (vm.js:80:10)\n at Object.runInThisContext (vm.js:139:10)\n at Module._compile (module.js:607:28)\n at Object.Module._extensions..js (module.js:654:10)\n at Module.load (module.js:556:32)\n at tryModuleLoad (module.js:499:12)\n at Function.Module._load (module.js:491:3)\n at Module.require (module.js:587:17)\n at require (internal/module.js:11:18)\n
The text was updated successfully, but these errors were encountered: