Just updated needle engine editor and I get this error

any idea why? :confused:

Original Post on Discord

by user 483253293477265409

Thatโ€™s when threejs is not installed. Make sure to check your package.json. Which Engine version are you using?

the latest update available, 3.25-exp

by user 483253293477265409

Whatโ€™s in your package.json for threejs?

Did you just update?

yep, just updated, Iโ€™m doing a clean install, Iโ€™ll check the packagejson when in a sec

by user 483253293477265409

Ok otherwise try restarting Unity. It sometimes blocks a folder from being cleaned up properly and the 3.x version removes the local Needle Engine / threejs versions

If the package.json does still contain a path to e.g. an empty / half empty threejs folder (and the folder exists) it doesnt detect that its broken (we only fix those paths if the folder doesnt exist, again this might be because of Unity not cleaning it up)

  "name": "my-project",
  "version": "1.0.0",
  "scripts": {
      "start": "vite --host",
      "pre-build": "tsc",
      "build:dev": "tsc && vite build && npm run copy-files",
      "build:production": "npm run build:dev && npm run gltf:transform",
      "serve": "vite preview",
      "copy-files": "copy-files-from-to",
      "gltf:transform": "npm run transform --prefix node_modules/@needle-tools/gltf-build-pipeline"
    },
  "dependencies": {
      "@danielblagy/three-mmi": "^1.0.0",
      "@needle-tools/engine": "^3.2.5-alpha"
    },
  "devDependencies": {
      "@needle-tools/needle-component-compiler": "^1.9.3",
      "@types/three": "0.146.0",
      "@vitejs/plugin-basic-ssl": "^0.1.2",
      "copy-files-from-to": "^3.7.0",
      "typescript": "^4.5.5",
      "vite": "^3.1.4",
      "vite-plugin-compression": "^0.5.1",
      "@needle-tools/editor-sync": "2.0.0-alpha",
      "@needle-tools/helper": "^0.6.4"
    },
  "copyFiles": [
    {
      "from": "assets/**/*.*",
      "to": "dist/assets/"
    },
    {
      "from": "node_modules/@needle-tools/engine/src/include/**/*.*",
      "to": "dist/include/"
    },
    {
      "from": "node_modules/@needle-tools/engine/src/include/**/*.*",
      "to": "./include/"
    },
    {
      "from": "include/**/*.*",
      "to": "dist/include/"
    }
  ]
}```

*by user 483253293477265409*

Do I manually try npm install threejs?

by user 483253293477265409

Clean install should fix it

I get this now

by user 483253293477265409

Can you show me the package.json of three in node_modules?

  "name": "three",
  "version": "0.126.1",
  "description": "JavaScript 3D library",
  "main": "build/three.js",
  "module": "build/three.module.js",
  "repository": {
    "type": "git",
    "url": "https://github.com/mrdoob/three.js"
  },
  "sideEffects": false,
  "files": [
    "build/three.js",
    "build/three.min.js",
    "build/three.module.js",
    "examples/js",
    "examples/jsm",
    "examples/fonts",
    "LICENSE",
    "package.json",
    "README.md",
    "src"
  ],
  "directories": {
    "doc": "docs",
    "example": "examples",
    "test": "test"
  },
  "eslintConfig": {
    "root": true,
    "extends": "mdcs",
    "plugins": [
      "html"
    ],
    "rules": {
      "quotes": [
        "error",
        "single"
      ],
      "prefer-const": [
        "error",
        {
          "destructuring": "any",
          "ignoreReadBeforeAssign": false
        }
      ]
    }
  },```

*by user 483253293477265409*
    "start": "npm run dev",
    "test": "npm run test-lint && npm run test-unit",
    "build": "rollup -c utils/build/rollup.config.js",
    "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080\"",
    "lint-fix": "eslint src --ext js --fix && eslint examples/js examples/jsm --ext js --ignore-pattern libs --fix",
    "lint-docs": "eslint docs --ext html",
    "lint-examples": "eslint examples/js examples/jsm --ext js --ignore-pattern libs",
    "test-lint": "eslint src --ext js",
    "test-unit": "npm run unit --prefix test",
    "test-unit-examples": "npm run unit-examples --prefix test",
    "test-e2e": "node test/e2e/puppeteer.js",
    "test-e2e-cov": "node test/e2e/check-coverage.js",
    "make-screenshot": "node test/e2e/puppeteer.js --make"
  },
  "keywords": [
    "three",
    "three.js",
    "javascript",
    "3d",
    "virtual-reality",
    "augmented-reality",
    "webgl",
    "webgl2",
    "webaudio",
    "webxr",
    "canvas",
    "svg",
    "html5"
  ],
  "author": "mrdoob",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/mrdoob/three.js/issues"
  },
  "homepage": "https://threejs.org/",
  "devDependencies": {
    "@babel/core": "^7.12.16",
    "@babel/plugin-proposal-class-properties": "^7.12.13",
    "@babel/preset-env": "^7.12.16",
    "@rollup/plugin-babel": "^5.3.0",
    "@rollup/plugin-node-resolve": "^11.2.0",
    "concurrently": "^5.3.0",
    "eslint": "^7.20.0",
    "eslint-config-mdcs": "^5.0.0",
    "eslint-plugin-html": "^6.1.1",
    "regenerator-runtime": "^0.13.7",
    "rollup": "^2.39.0",
    "rollup-plugin-terser": "^7.0.2",
    "servez": "^1.11.0"
  },
  "jspm": {
    "files": [
      "package.json",
      "LICENSE",
      "README.md",
      "build/three.js",
      "build/three.min.js",
      "build/three.module.js"
    ],
    "directories": {}
  }
}

by user 483253293477265409

Thatโ€™s a super old threejs version. Can you add threejs to your package.json dependencies?

You can just write "three" : " " in the dependencies and click the install button on ExportInfo

it will fill in the correct version

In theory it is installing it now

by user 483253293477265409

Solved!

by user 483253293477265409