New build system in our main repository

When I try to do the npm i step this error keeps dropping:

My master branch is up to date with the upstream and I followed all prior steps to the install run.

make sure you are on node 16
(I use nvm to easily switch)

I was using 14.15.5 so that might be it.

Update
Looks to be it. Should the docs say 16 and up instead of 14 then maybe?

good point. CC @RaananW

This is probably an npm version issue and not a node issue. we support npm 7+ (better - 8+). I am glad node 16 worked for you (i assume - because it comes with npm 8). If you could try updating your npm on node 14 and give it a try it would be great.

I am testing with both node 14 and 16 (and honestly keep on forgetting wehat version I am currently using ;-)). I’ll test it again to be sure.

So I have been trying to run a local playground so I can test the nine patch fixes. When I run

npm run serve -w @tools/babylon-server
everything is fine until this finishes:

Once that gets to a certain point the playground stops working and I get a bunch of compiler errors.

ERROR in ./src/sceneJs.js 3:0-44
Module not found: Error: Can't resolve './createScene' in 'F:\gitHUB\Babylon.js\packages\tools\babylonServer\src'
resolve './createScene' in 'F:\gitHUB\Babylon.js\packages\tools\babylonServer\src'
  using description file: F:\gitHUB\Babylon.js\packages\tools\babylonServer\package.json (relative path: ./src)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: F:\gitHUB\Babylon.js\packages\tools\babylonServer\package.json (relative path: ./src/createScene)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createScene doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createScene.js doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createScene.ts doesn't exist
      .tsx
        Field 'browser' doesn't contain a valid alias configuration
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createScene.tsx doesn't exist
      as directory
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createScene doesn't exist

ERROR in ./src/sceneJs.js 4:0-46
Module not found: Error: Can't resolve './createEngine' in 'F:\gitHUB\Babylon.js\packages\tools\babylonServer\src'
resolve './createEngine' in 'F:\gitHUB\Babylon.js\packages\tools\babylonServer\src'
  using description file: F:\gitHUB\Babylon.js\packages\tools\babylonServer\package.json (relative path: ./src)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: F:\gitHUB\Babylon.js\packages\tools\babylonServer\package.json (relative path: ./src/createEngine)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createEngine doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createEngine.js doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createEngine.ts doesn't exist
      .tsx
        Field 'browser' doesn't contain a valid alias configuration
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createEngine.tsx doesn't exist
      as directory
        F:\gitHUB\Babylon.js\packages\tools\babylonServer\src\createEngine doesn't exist

webpack 5.70.0 compiled with 2 errors in 100024 ms

Sometimes restarting the server fixes it, but it soon returns to this state even without me doing anything.

can you run npm run prepare -w @tools/babylon-server ? You are missing the two auto-generated files, and it seems like the prepare script didn’t run correctly on your device

Continue from ShaderCodeCursor. Optimization of lines parsing by Dok11 · Pull Request #13935 · BabylonJS/Babylon.js · GitHub
I have npm v. 9.5.1 and node v. 19.8.1, I have described above troubles even after your commands:

$ npm run test:visualization

> @babylonjs/root@1.0.0 test:visualization
> jest --selectProjects=visualization --runInBand

Running one project: visualization
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typ
escript-2-7/#easier-ecmascript-module-interoperability for more information.
 FAIL   visualization  packages/tools/tests/test/visualization/visualization.webgl2.test.ts
  ● Test suite failed to run

    Unable to find native addon file "C:\OSPanel\domains\Babylon.js\node_modules\node-libpng\node-libpng-win32-x64-111.node".

      at Object.<anonymous> (node_modules/node-libpng/src/native.ts:8:11)
      at Object.<anonymous> (node_modules/node-libpng/src/encode.ts:2:1)

 FAIL   visualization  packages/tools/tests/test/visualization/visualization.webgpu.test.ts
  ● Test suite failed to run

    Unable to find native addon file "C:\OSPanel\domains\Babylon.js\node_modules\node-libpng\node-libpng-win32-x64-111.node".

      at Object.<anonymous> (node_modules/node-libpng/src/native.ts:8:11)
      at Object.<anonymous> (node_modules/node-libpng/src/encode.ts:2:1)

 FAIL   visualization  packages/tools/tests/test/visualization/visualization.webgl1.test.ts
  ● Test suite failed to run

    Unable to find native addon file "C:\OSPanel\domains\Babylon.js\node_modules\node-libpng\node-libpng-win32-x64-111.node".

      at Object.<anonymous> (node_modules/node-libpng/src/native.ts:8:11)
      at Object.<anonymous> (node_modules/node-libpng/src/encode.ts:2:1)

Test Suites: 3 failed, 3 total
Tests:       0 total
Snapshots:   0 total
Time:        0.828 s
Ran all test suites.

node_modules is
image

Is there any decision for now?

I tried to uninstall this package and install @latest, but it fails:

$ npm install node-libpng@latest
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\OSPanel\\domains\\Babylon.js\\node_modules\\node-libpng',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\OSPanel\domains\Babylon.js\node_modules\node-libpng\src'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\OSPanel\\domains\\Babylon.js\\node_modules\\node-libpng\\src'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\OSPanel\domains\Babylon.js\node_modules\node-libpng
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/install.js
npm ERR! Downloading node-libpng prebuilt binary from "https://github.com/Prior99/node-libpng/releases/download/0.2.20/node-libpng-win32-x64-111.node".
npm ERR! C:\OSPanel\domains\Babylon.js\node_modules\node-libpng\scripts\install.js:30
npm ERR!             throw new Error(`No supported node-libpng ${packageVersion} build found for node ${process.version} on ${process.platform} (${process.arch}).`);
npm ERR!             ^
npm ERR!
npm ERR! Error: No supported node-libpng 0.2.20 build found for node v19.8.1 on win32 (x64).

node-libpng seems to be the issue:

I’ll add a task to find a replacement asap

if you use a hard coded version for node addons, it almost always fails. you can normally use “*” as the version number to make it work.

dok11, the eperm thing is just a consequence of some external program writing to your fs not running under node, on windows you can just use shift + delete on the folder to delete it (and not send to trash, just perma delete)

what a wonderful way to get your build system to sporadically fail :slight_smile: . Not to mention the security implications of that. There is a good reason not to do that on a large scale project.

In this case, however, I will need to find a different binding or a whole different library, as it is only available until node 16. has nothing to do with a fixed version of anything. The developers simply stopped providing bindings. i’ll keep you all updated.

No different than using ^

yes and no. We maintain backwards compatibility. Anyhow, it wouldn’t have helped here.

Working on a fix now