Closed jsumners-nr closed 5 months ago
๐ค
Hey there, @jsumners-nr! Good to see you again. I see you've run into another issue. Let's dive in and see what we can do.
The ERR_PACKAGE_PATH_NOT_EXPORTED
error is thrown when a package's package.json
file has an exports
field, but the requested module path is not defined in this field. In your case, it seems like the @langchain/community
package's package.json
file does not define a main export, which is why you're seeing this error when you try to import the package using require('@langchain/community')
.
To resolve this issue, you should import the specific module path that is defined in the exports
field of the @langchain/community
package's package.json
file. For example, if the exports
field looks like this:
"exports": {
"./load": {
"import": "./dist/load/index.js",
"require": "./dist/load/index.cjs"
}
}
You should import the package like this:
const lcc = require('@langchain/community/load')
The MODULE_NOT_FOUND
error is thrown when Node.js cannot find a module that you're trying to import. In your case, it seems like the @langchain/community
package is trying to import the @gomomento/sdk-core
package, but it's not installed in your project.
To resolve this issue, you should install the @gomomento/sdk-core
package by running the following command in your terminal:
npm install @gomomento/sdk-core --save
Or if you're using Yarn:
yarn add @gomomento/sdk-core
After running this command, the @gomomento/sdk-core
package should be added to your dependencies
in the package.json
file, and the MODULE_NOT_FOUND
error should be resolved.
Please try these solutions and let me know if you're still encountering any issues. If you have any other questions or need further clarification, feel free to ask.
Best regards, Dosu
This response is meant to be useful and save you time. 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.
If you want to continue the conversation, start your reply with @dosu-bot.
Please go away bot. I want a human to look at this.
๐ค
It seems like this issue requires a deeper look, @jacoblee93 could you please lend your expertise?
This response is meant to be useful and save you time. 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.
If you want to continue the conversation, start your reply with @dosu-bot.
Thanks for the report!
I suppose the error could be clearer, but this is by design as there is no default entrypoint for @langchain/community
.
Then how is this package supposed to be used?
.npmrc
``` package-lock=false install-strategy=nested ```package.json
```json { "dependencies": { "@langchain/community": "^0.0.18" } } ```index.js
```js 'use strict' const lcc = require('@langchain/community') console.dir(lcc) ```Using the above reproduction, running
node index.js
results in:If we update
index.js
like so:We instead get: