opensea-js icon indicating copy to clipboard operation
opensea-js copied to clipboard

Error: Cannot find module 'wyvern-schemas/dist/types'

Open qiushui777 opened this issue 4 years ago • 17 comments

Hi I got this error while trying to use the sdk.

node:internal/modules/cjs/loader:933
  const err = new Error(message);
              ^

Error: Cannot find module 'wyvern-schemas/dist/types'
Require stack:
- /root/dev//node_modules/opensea-js/lib/utils/schema.js
- /root/dev//node_modules/opensea-js/lib/utils/index.js
- /root/dev//node_modules/opensea-js/lib/orders/utils.js
- /root/dev//node_modules/opensea-js/lib/api.js
- /root/dev//node_modules/opensea-js/lib/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    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> (/root/dev/openseaarb/node_modules/opensea-js/lib/utils/schema.js:26:15)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/root/dev/openseaarb/node_modules/opensea-js/lib/utils/index.js:13:14)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/root/dev/openseaarb/node_modules/opensea-js/lib/utils/schema.js',
    '/root/dev/openseaarb/node_modules/opensea-js/lib/utils/index.js',
    '/root/dev/openseaarb/node_modules/opensea-js/lib/orders/utils.js',
    '/root/dev/openseaarb/node_modules/opensea-js/lib/api.js',
    '/root/dev/openseaarb/node_modules/opensea-js/lib/index.js'
  ]
}

here are my dependecies

  "dependencies": {
    "opensea-js": "^4.0.3",
    "web3": "^1.7.4"
  }

qiushui777 avatar Jun 28 '22 07:06 qiushui777

I have same issue.

justspd avatar Jun 28 '22 19:06 justspd

I was having the same issue but managed to get around it by deleting the wyvern-schemas package and any reference to it in package-lock.json. I then npm installed wyvern-schemas and it worked.

javiergrau avatar Jun 29 '22 17:06 javiergrau

I was having the same issue but managed to get around it by deleting the wyvern-schemas package and any reference to it in package-lock.json. I then npm installed wyvern-schemas and it worked.

thx for the reply. May I ask how you delete the reference to it?

    "node_modules/opensea-js": {
      "version": "4.0.3",
      "resolved": "https://registry.npmjs.org/opensea-js/-/opensea-js-4.0.3.tgz",
      "integrity": "sha512-kLY8wwbbPOu/FGS/0AdpNiWZCSZo6Megh0ku3omJVU1KABGDT6I6ggFbhg7DNbyUubfD/0V0dtrwCDrf6YGGsw==",
      "dependencies": {
        "@opensea/seaport-js": "^1.0.0",
        "ajv": "^8.11.0",
        "bignumber.js": "9.0.2",
        "ethereumjs-abi": "git+https://github.com/ProjectWyvern/ethereumjs-abi.git",
        "ethereumjs-util": "^5.2.0",
        "ethers": "^5.6.6",
        "fbemitter": "2.1.1",
        "isomorphic-unfetch": "^2.1.1",
        "lodash": "^4.17.21",
        "query-string": "^6.11.1",
        "web3": "1.7.0",
        "wyvern-js": "git+https://github.com/ProjectOpenSea/wyvern-js.git#d283749f3d983a9c9e2e4da925441f75e170c9f0",
        "wyvern-schemas": "git+https://github.com/ProjectOpenSea/wyvern-schemas.git#3290fc095649f5552b560bfcb1f0fa49acf13894"
      }
    },

like I delete the

        "wyvern-schemas": "git+https://github.com/ProjectOpenSea/wyvern-schemas.git#3290fc095649f5552b560bfcb1f0fa49acf13894"

part? I delete all these and uninstall the wyvern-schemas then install again. But failed with the same error

qiushui777 avatar Jul 01 '22 02:07 qiushui777

Same error, how to fix? tried install wyvern-schemas, but the same. Tried all what write here - the same error. Mac M1. thanks

alex-bormotov avatar Jul 05 '22 15:07 alex-bormotov

Same error, how to fix? tried install wyvern-schemas, but the same. Tried all what write here - the same error. Mac M1. thanks

I've had various issues with opensea-js over the past couple weeks, but weirdly enough it works fine if I use yarn to install it (just "yarn add opensea-js").

beauhodes avatar Jul 05 '22 22:07 beauhodes

A quick fix I did for NPM:

Go to node_modules/wyvern-schemas

Download the Git reference in the package-lock for opensea-js, for 4.0.4 it's https://github.com/ProjectOpenSea/wyvern-schemas#3290fc095649f5552b560bfcb1f0fa49acf13894=

Unzip that folder there.

Of course, this has to be done after every npm install, just don't delete node_modules 😩

jamesrwaugh avatar Jul 10 '22 23:07 jamesrwaugh

Why was this closed? This issue is still occuring

sarahkittyy avatar Jul 12 '22 18:07 sarahkittyy

agreed. This should still be open...

Fraeddy avatar Jul 12 '22 19:07 Fraeddy

@jamesrwaugh and @beauhodes 's solutions not working? I just gave up and wrote one in py on my own.

qiushui777 avatar Jul 13 '22 02:07 qiushui777

It

Same error, how to fix? tried install wyvern-schemas, but the same. Tried all what write here - the same error. Mac M1. thanks

I've had various issues with opensea-js over the past couple weeks, but weirdly enough it works fine if I use yarn to install it (just "yarn add opensea-js").

Yep, it works for me if i install node_modules with yarn rather than npm. (I'm using WSL2)

KModestas avatar Jul 21 '22 14:07 KModestas

On my side, the issue was caused by the missing dist folder when pulling wyvern-schemas from Github. If you look at node_modules/wyvern-schemas, it will be missing the dist folder.

I also didn't want to npm/yarn install wyvern-schema since it would install 0.6.5 from npm which dates back five years ago instead of the fork of it referenced here in the package.json

The solution on my side ended up having to install yarn (not yarn install, just install it through npm i -g yarn). Once yarn was installed on my machine (or ci server), I simply deleted node_modules/wyvern-schemas, ran npm install again, and the dist folder that I mentioned above is now properly generated.

Could it be caused by the fact that wyvern-schemas fork has a prepublish script that calls a bash script that calls yarn? Would be nice to fix that script to accept either yarn or npm. Or run it though npx?

alex-lighthouse avatar Sep 29 '22 18:09 alex-lighthouse

On my side, the issue was caused by the missing dist folder when pulling wyvern-schemas from Github. If you look at node_modules/wyvern-schemas, it will be missing the dist folder.

I also didn't want to npm/yarn install wyvern-schema since it would install 0.6.5 from npm which dates back five years ago instead of the fork of it referenced here in the package.json

The solution on my side ended up having to install yarn (not yarn install, just install it through npm i -g yarn). Once yarn was installed on my machine (or ci server), I simply deleted node_modules/wyvern-schemas, ran npm install again, and the dist folder that I mentioned above is now properly generated.

Could it be caused by the fact that wyvern-schemas fork has a prepublish script that calls a bash script that calls yarn? Would be nice to fix that script to accept either yarn or npm. Or run it though npx?

--- Can confirm this did resolve issue for me

xin-xinusu avatar Oct 26 '22 16:10 xin-xinusu

Getting this error in my Google cloud console upon deploying a cloud function. I imagine the gcloud deploy node runtime uses npm which is why this might be happening? Function runs fine locally with functions-framework cause my project workspace is built with yarn and the dist file is there. Any idea of a solve/work around?

qnft-mjb avatar Oct 26 '22 22:10 qnft-mjb

Using yarn instead of npm fixes this for me...

yarn add opensea-js

ds-hamza avatar Nov 11 '22 12:11 ds-hamza

On my side, the issue was caused by the missing dist folder when pulling wyvern-schemas from Github. If you look at node_modules/wyvern-schemas, it will be missing the dist folder.

I also didn't want to npm/yarn install wyvern-schema since it would install 0.6.5 from npm which dates back five years ago instead of the fork of it referenced here in the package.json

The solution on my side ended up having to install yarn (not yarn install, just install it through npm i -g yarn). Once yarn was installed on my machine (or ci server), I simply deleted node_modules/wyvern-schemas, ran npm install again, and the dist folder that I mentioned above is now properly generated.

Could it be caused by the fact that wyvern-schemas fork has a prepublish script that calls a bash script that calls yarn? Would be nice to fix that script to accept either yarn or npm. Or run it though npx?

It works! Thanks

kevgithub avatar Nov 23 '22 04:11 kevgithub

While using yarn to install opensea-js a WARNING message is raised:

warning "opensea-js > [email protected]" has incorrect peer dependency "wyvern-js@git+https://github.com/ProjectOpenSea/wyvern-js.git#7429b1f2dd123f012cae1f3144a069e91ecd0682".

Maybe this is related to the problem. To be continued !

KoolKat-Bytes avatar Dec 19 '22 08:12 KoolKat-Bytes

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

github-actions[bot] avatar May 24 '23 04:05 github-actions[bot]