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

matter-js cannot find #231

Closed
Lyoko-Jeremie opened this issue Dec 8, 2021 · 3 comments
Closed

matter-js cannot find #231

Lyoko-Jeremie opened this issue Dec 8, 2021 · 3 comments

Comments

@Lyoko-Jeremie
Copy link

Describe the bug

  "dependencies": {
    "@tweenjs/tween.js": "^18.6.4",
    "@types/three": "~0.133.0",
    "ammojs-typed": "^1.0.6",
    "bluebird": "^3.7.2",
    "enable3d": "^0.24.1",
    "json5": "^2.2.0",
    "lodash": "^4.17.20",
    "moment": "^2.29.1",
    "rxjs": "~6.6.0",
    "socket.io": "^3.0.3",
    "socket.io-client": "^3.0.4",
    "three": "~0.133.0",
    "tslib": "^2.0.0"
  },
  "devDependencies": {
    "@types/bluebird": "^3",
    "@types/lodash": "^4.14.168",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.0.2"
  }
../node_modules/@enable3d/three-graphics/jsm/flat/physics/physics.js:6:0-98 - Error: Module not found: Error: Can't resolve 'matter-js' in '\node_modules\@enable3d\three-graphics\jsm\flat\physics'

Error: ../node_modules/@enable3d/three-graphics/jsm/flat/physics/physics.d.ts:6:54 - error TS2307: Cannot find module 'matter-js' or its corresponding type declarations.

6 import { Body, Engine, Render, Runner, Vector } from 'matter-js';

after i upgrade enable3d to v0.24.1 (three to r133).

what's wrong ?

@Lyoko-Jeremie
Copy link
Author

ref #224

@yandeu
Copy link
Member

yandeu commented Dec 8, 2021

Try:

  1. Remove all enable3d related packages from package.json.
  2. Delete package-lock.json.
  3. Delete node_modules folder.
  4. run npm install enable3d@latest.

No need for manually installing three or @types/three.

@Lyoko-Jeremie
Copy link
Author

oh~
after i add "@types/matter-js" and "matter-js" to my package.json, it works

  "dependencies": {
    "@tweenjs/tween.js": "^18.6.4",
    "@types/matter-js": "~0.17.6",
    "@types/three": "~0.133.1",
    "ammojs-typed": "^1.0.6",
    "bluebird": "^3.7.2",
    "enable3d": "^0.24.1",
    "json5": "^2.2.0",
    "lodash": "^4.17.20",
    "matter-js": "~0.17.1",
    "moment": "^2.29.1",
    "rxjs": "~6.6.0",
    "socket.io": "^3.0.3",
    "socket.io-client": "^3.0.4",
    "three": "~0.133.1",
    "tslib": "^2.0.0"
  },
  "devDependencies": {
    "@types/bluebird": "^3",
    "@types/lodash": "^4.14.168",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.0.2"
  }

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

2 participants