Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

How can I use the npm module <@traderjoe-xyz/sdk> #29

Open
crazydevlegend opened this issue Jul 8, 2022 · 1 comment
Open

How can I use the npm module <@traderjoe-xyz/sdk> #29

crazydevlegend opened this issue Jul 8, 2022 · 1 comment

Comments

@crazydevlegend
Copy link

crazydevlegend commented Jul 8, 2022

I just installed node_module @traderjoe-xyz/sdk using npm i @traderjoe-xyz/sdk to use it in my node.js project.
But when I tried to import it in my code, I showed an error:

node:internal/modules/cjs/loader:361
      throw err;
      ^

Error: Cannot find module '/home/<USER-NAME>/Desktop/projects/<PROJECT-NAME>/node_modules/@traderjoe-xyz/sdk/dist/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:353:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/<USER-NAME>/Desktop/projects/<PROJECT-NAME>/<SUBDIRECTORIES...>/traderjoe.js:1:70)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/home/<USER-NAME>/Desktop/projects/<PROJECT-NAME>/node_modules/@traderjoe-xyz/sdk/package.json',
  requestPath: '@traderjoe-xyz/sdk'
}

I checked the module directory inside node_modules folder, but it didn't have dist/index.js file.

Can anyone tell me how can I overcome this issue?

Any advice/help is appreciated!

Long story short, I WANNA USE TRADERJOE-XYZ/SDK IN MY NODE.JS PROJECT

@crazydevlegend
Copy link
Author

I cloned this repository and created my own build version of the SDK library.
And finally it works!
Maybe this library is not stable yet, and still under development. (I can see some recent updates ...).

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

No branches or pull requests

1 participant