Hi, following a thread on hidden line removal with Deltakosh…
https://forum.babylonjs.com/t/ideas-for-hidden-line-removal/9845/4
… I started out downloading everything so that I can start to experiment editing and building BabylonJS locally.
I followed the instructions on…
https://doc.babylonjs.com/how_to/how_to_start
and encountered some problems - some I resolved others not yet. I thought it best to document the steps taken so far as well as the unresolved - offered as a questions but also as an offering for consideration in documentation.
-
Unfortunately I did not take notes on this point but basically I had to run quite a few of the CLI commands on “how to start” using sudo they required super user permission. I should have noted down which commands but unfortunately I did not. Linux users might benefit from being advised - “try sudo in the event of failure”.
-
I then came across a problem
============ log start ============================
1 verbose cli [ ‘/snap/node/2647/bin/node’, ‘/usr/local/bin/npm’, ‘run’, ‘build’ ]
2 info using npm@6.14.4
3 info using node@v14.0.0
4 verbose run-script [ ‘prebuild’, ‘build’, ‘postbuild’ ]
5 info lifecycle babylonjs@0.0.0~prebuild: babylonjs@0.0.0
6 info lifecycle babylonjs@0.0.0~build: babylonjs@0.0.0
7 warn lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2647/bin/node itself. Use the --scripts-prepend-node-path
option to include the path for the node binary npm was executed with.
8 verbose lifecycle babylonjs@0.0.0~build: unsafe-perm in lifecycle true
9 verbose lifecycle babylonjs@0.0.0~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/jon/Babylon.js/Tools/Gulp/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
10 verbose lifecycle babylonjs@0.0.0~build: CWD: /home/jon/Babylon.js/Tools/Gulp
11 silly lifecycle babylonjs@0.0.0~build: Args: [ ‘-c’, ‘gulp --max-old-space-size=8192 --tsLintFix’ ]
12 silly lifecycle babylonjs@0.0.0~build: Returned: code: 1 signal: null
13 info lifecycle babylonjs@0.0.0~build: Failed to exec build script
14 verbose stack Error: babylonjs@0.0.0 build: gulp --max-old-space-size=8192 --tsLintFix
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
14 verbose stack at EventEmitter.emit (events.js:315:20)
14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
14 verbose stack at ChildProcess.emit (events.js:315:20)
14 verbose stack at maybeClose (internal/child_process.js:1051:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
15 verbose pkgid babylonjs@0.0.0
16 verbose cwd /home/jon/Babylon.js/Tools/Gulp
17 verbose Linux 4.15.0-96-generic
18 verbose argv “/snap/node/2647/bin/node” “/usr/local/bin/npm” “run” “build”
19 verbose node v14.0.0
20 verbose npm v6.14.4
21 error code ELIFECYCLE
22 error errno 1
23 error babylonjs@0.0.0 build: gulp --max-old-space-size=8192 --tsLintFix
23 error Exit status 1
24 error Failed at the babylonjs@0.0.0 build script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
==================== log end ===============================
Being new to git / npm and node I fished around.
One measure taken was to stop my Apache2 local server which is what I run BabylonJS on.
The second measure which seemed to be the “fix” centered around item 7 in the above log ( I am not sure if the stop apache2 step was a factor ).
Advice on https://github.com/npm/npm/issues/15398 was followed namely I entered
npm config set scripts-prepend-node-path true
at the CLI.
- As far as I can make out I have built successfully but now fail to run tests due to headless browser (Chrome) associated errrors.
===== log start ======================
[16:31:10] Finished ‘buildes6’ after 40 s
[16:31:10] Starting ‘copyDist’…
[16:31:10] Finished ‘copyDist’ after 30 ms
[16:31:10] Finished ‘nodeEditor-es6’ after 41 s
[16:31:10] Finished ‘typescript-es6’ after 3.38 min
[16:31:10] Starting ‘netlify-cleanup’…
[16:31:10] Finished ‘netlify-cleanup’ after 391 μs
[16:31:10] Finished ‘typescript-all’ after 7.68 min
[16:31:10] Starting ‘documentation’…
[16:31:11] Finished ‘documentation’ after 107 ms
[16:31:11] Starting ‘typedoc-all’…
[16:31:11] Starting ‘typedoc-generate’…
[16:31:33] Finished ‘typedoc-generate’ after 23 s
[16:31:33] Starting ‘typedoc-validate’…
[16:31:34] All formatting check passed successfully during the validation !
[16:31:34] Finished ‘typedoc-validate’ after 799 ms
[16:31:34] Starting ‘typedoc-generateValidationBaseline’…
[16:31:35] All formatting check passed successfully during the baseline generation !
[16:31:35] Finished ‘typedoc-generateValidationBaseline’ after 773 ms
[16:31:35] Finished ‘typedoc-all’ after 24 s
[16:31:35] Starting ‘tests-all’…
[16:31:35] Starting ‘tests-unit’…
[16:31:35] Starting ‘tests-babylon-unit’…
[16:31:35] Starting ‘tests-unit-transpile’…
[16:31:40] Finished ‘tests-unit-transpile’ after 5.48 s
[16:31:40] Starting ‘’…
28 04 2020 16:31:41.149:WARN [config]: urlRoot normalized to “/karma/”
28 04 2020 16:31:41.564:WARN [filelist]: Pattern “/home/jon/Babylon.js/!./**/*.d.ts” does not match any file.
28 04 2020 16:31:57.807:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:3000/karma/
28 04 2020 16:31:57.810:INFO [launcher]: Launching browsers ChromeHeadless with concurrency 1
28 04 2020 16:31:57.832:INFO [launcher]: Starting browser ChromeHeadless
28 04 2020 16:31:59.558:ERROR [launcher]: Cannot start ChromeHeadless
[0428/163159.524084:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
28 04 2020 16:31:59.559:ERROR [launcher]: ChromeHeadless stdout:
28 04 2020 16:31:59.559:ERROR [launcher]: ChromeHeadless stderr: [0428/163159.524084:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
28 04 2020 16:31:59.562:INFO [launcher]: Trying to start ChromeHeadless again (1/2).
28 04 2020 16:31:59.702:ERROR [launcher]: Cannot start ChromeHeadless
[0428/163159.699453:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
28 04 2020 16:31:59.703:ERROR [launcher]: ChromeHeadless stdout:
28 04 2020 16:31:59.703:ERROR [launcher]: ChromeHeadless stderr: [0428/163159.699453:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
28 04 2020 16:31:59.704:INFO [launcher]: Trying to start ChromeHeadless again (2/2).
28 04 2020 16:31:59.825:ERROR [launcher]: Cannot start ChromeHeadless
[0428/163159.822887:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
28 04 2020 16:31:59.826:ERROR [launcher]: ChromeHeadless stdout:
28 04 2020 16:31:59.826:ERROR [launcher]: ChromeHeadless stderr: [0428/163159.822887:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
28 04 2020 16:31:59.827:ERROR [launcher]: ChromeHeadless failed 2 times (cannot start). Giving up.
[16:31:59] ‘’ errored after 19 s
[16:31:59] Error: 1
at formatError (/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/format-error.js:21:10)
at Gulp. (/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/log/events.js:33:15)
at Gulp.emit (events.js:327:22)
at Gulp.EventEmitter.emit (domain.js:485:12)
at Object.error (/home/jon/Babylon.js/node_modules/undertaker/lib/helpers/createExtensions.js:61:10)
at handler (/home/jon/Babylon.js/node_modules/now-and-later/lib/mapSeries.js:47:14)
at f (/home/jon/Babylon.js/node_modules/once/once.js:25:25)
at f (/home/jon/Babylon.js/node_modules/once/once.js:25:25)
at tryCatch (/home/jon/Babylon.js/node_modules/async-done/index.js:24:15)
at done (/home/jon/Babylon.js/node_modules/async-done/index.js:40:12)
at removeAllListeners (/home/jon/Babylon.js/node_modules/karma/lib/server.js:370:9)
at /home/jon/Babylon.js/node_modules/karma/lib/server.js:381:13
at Server.close (net.js:1603:9)
at Object.onceWrapper (events.js:421:28)
at Server.emit (events.js:327:22)
at Server.EventEmitter.emit (domain.js:547:15)
[16:31:59] ‘tests-babylon-unit’ errored after 25 s
[16:31:59] ‘tests-unit’ errored after 25 s
[16:31:59] ‘tests-all’ errored after 25 s
[16:31:59] ‘default’ errored after 9.18 min
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! babylonjs@0.0.0 build: gulp --max-old-space-size=8192 --tsLintFix
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the babylonjs@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jon/.npm/_logs/2020-04-28T15_31_59_971Z-debug.log
============ log end ==================
I will continue to poke away, grateful for any advice.
Also interested to gain a perspective on this - is it likely that the build was successful but I simply cannot run the tests due to headless browser issues.
I am also interested to know if the CLI command
npm run build
Are there any options to avoid repeating build steps already successfully completed?
During my ignorant handling of these errors repeated build attempts have take a long time to get to the point of failure ( or a new point of failure ). I wondered if there were any options that could take account of successfully completed build steps and avoid some repetition ( kind of full build or partial build options ?).
Thanks
Jon