Modifying documentation

Silly question :slight_smile:

I have a local clone of the documentation for modification. However, while running locally it gives me error for some of the pages. (babylon101, how_to, features, resources, extensions, snippets). with /xxx not found error.

Other pages (Home, What’s new, examples, API, playground) works fine.

Any suggestions where to look. (I haven’t done any modification yet :frowning: )? (sorry not much of an expert here)

Regards,
Balu

I’m far from knowing grunt, but have you use grunt build before grunt serve? On my PC I also had, before asking for grunt, to redo a npm install.

No questions are silly. This might be a silly answer.

Have you read Improve Documentation - Babylon.js Documentation ?

Are as @Vinc3r suggested both NPM and Grunt up to date?

1 Like

Yup. All installed. Grunt, grunt-cli etc.
Grunt build does throw an error as per the image in the OP.
“Primordials is not defined” at compilehtmlstatics . That sounded deeply philosophical to me.

Even the worst questions are still good questions :stuck_out_tongue:

:slight_smile: this does make me feel silly.

…and yes. Documentation and steps followed. (at least that is what i think)

Im not even in the same realm with what youre doing, gotta love good docs tho.

so lets’ ping @Deltakosh

Just pulled the latest version of the documentation into my local repo. Had to re-install grunt and grunt-cli before grunt build worked.

In the documentation directory I did

npm install grunt
npm install
npm install -g grunt-cli
grunt build

Currently I have

$ npm -v
6.9.0

$ grunt -version
grunt-cli v1.3.2
grunt v1.0.4

TL;DR
As a point of interest when I did my first grunt build I got

$ grunt build
>> Local Npm module "grunt-download" not found. Is it installed?
>> Local Npm module "grunt-http-download" not found. Is it installed?
>> Local Npm module "grunt-http-download" not found. Is it installed?
Warning: Task "download:documentation" not found. Use --force to continue.

So I then did npm install and got these messages

$ npm install
npm WARN deprecated @types/handlebars@4.1.0: This is a stub types definition. ha                         ndlebars provides its own type definitions, so you do not need this installed.
npm WARN rollback Rolling back node-pre-gyp@0.12.0 failed (this is probably harm                         less): EPERM: operation not permitted, lstat 'C:\Users\User\Documents\GitHub\Doc                         umentation\node_modules\fsevents\node_modules'
npm WARN grunt-contrib-clean@0.6.0 requires a peer of grunt@~0.4.0 but none is i                         nstalled. You must install peer dependencies yourself.
npm WARN grunt-contrib-watch@0.6.1 requires a peer of grunt@~0.4.0 but none is i                         nstalled. You must install peer dependencies yourself.
npm WARN grunt-execute@0.2.2 requires a peer of grunt@~0.4.1 but none is install                         ed. You must install peer dependencies yourself.
npm WARN grunt-express-server@0.4.19 requires a peer of grunt@~0.4.0 but none is                          installed. You must install peer dependencies yourself.
npm WARN grunt-http-download@0.1.0 requires a peer of grunt@~0.4.0 but none is i                         nstalled. You must install peer dependencies yourself.
npm WARN The package extend is included as both a dev and production dependency.
npm WARN The package lodash is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules\fse                         vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@                         1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}                         )

added 4 packages from 2 contributors, removed 1 package, updated 12 packages and                          audited 3653 packages in 81.436s
found 60 vulnerabilities (16 low, 21 moderate, 22 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

So I then installed grunt followed by npm followed by npm install -g grunt-cli with messages

$ npm install grunt
npm WARN rm not removing C:\Users\User\Documents\GitHub\Documentation\node_modules\.bin\grunt.cmd as it wasn't installed by C:\Users\User\Documents\GitHub\Documentation\node_modules\grunt
npm WARN rm not removing C:\Users\User\Documents\GitHub\Documentation\node_modules\.bin\grunt as it wasn't installed by C:\Users\User\Documents\GitHub\Documentation\node_modules\grunt
npm WARN grunt-contrib-clean@0.6.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-contrib-watch@0.6.1 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-execute@0.2.2 requires a peer of grunt@~0.4.1 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-express-server@0.4.19 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-http-download@0.1.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package extend is included as both a dev and production dependency.
npm WARN The package lodash is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ grunt@1.0.4
removed 1 package, updated 3 packages and audited 3653 packages in 21.183s
found 58 vulnerabilities (16 low, 20 moderate, 21 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

$ npm install
npm WARN grunt-contrib-clean@0.6.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-contrib-watch@0.6.1 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-execute@0.2.2 requires a peer of grunt@~0.4.1 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-express-server@0.4.19 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-http-download@0.1.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package extend is included as both a dev and production dependency.
npm WARN The package lodash is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

audited 3653 packages in 38.062s
found 58 vulnerabilities (16 low, 20 moderate, 21 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
$ npm install -g grunt-cli
C:\Users\User\AppData\Roaming\npm\grunt -> C:\Users\User\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt
+ grunt-cli@1.3.2
updated 3 packages in 12.904s

At no point did I did

run `npm audit fix` to fix them, or `npm audit` 

Then grunt build worked

1 Like

I will update the doc’ about updating the doc’ with a new section “Common issues” or something like that, could be useful to everyone :woozy_face:

In the same way I don’t remember talking about git fetch upstream, git checkout master etc. These commands was very hard for me to understand when start using forks on Github, 'could help also a lot of people.

@JohnK,
Thanks for the detailed info. I had done multiple sequences of the same without much success. Here is how it goes for me following your steps. Fresh clone.

PS C:\Users\balup\Documents\source\repos\Documentation> npm -v
6.9.0
PS C:\Users\balup\Documents\source\repos\Documentation> grunt -version
grunt-cli v1.3.2
grunt v1.0.4

Now i do the npm install

PS C:\Users\balup\Documents\source\repos\Documentation> npm install
npm WARN grunt-contrib-clean@0.6.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-contrib-watch@0.6.1 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-execute@0.2.2 requires a peer of grunt@~0.4.1 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-express-server@0.4.19 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-http-download@0.1.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package extend is included as both a dev and production dependency.
npm WARN The package lodash is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

audited 3656 packages in 7.553s
found 50 vulnerabilities (16 low, 18 moderate, 16 high)
run npm audit fix to fix them, or npm audit for details

Next install grunt again

PS C:\Users\balup\Documents\source\repos\Documentation> npm install grunt
npm WARN rm not removing C:\Users\balup\Documents\source\repos\Documentation\node_modules.bin\grunt.cmd as it wasn’t installed by C:\Users\balup\Documents\source\repos\Documentation\node_modules\grunt
npm WARN rm not removing C:\Users\balup\Documents\source\repos\Documentation\node_modules.bin\grunt as it wasn’t installed by C:\Users\balup\Documents\source\repos\Documentation\node_modules\grunt
npm WARN grunt-contrib-clean@0.6.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-contrib-watch@0.6.1 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-execute@0.2.2 requires a peer of grunt@~0.4.1 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-express-server@0.4.19 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-http-download@0.1.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package extend is included as both a dev and production dependency.
npm WARN The package lodash is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

  • grunt@1.0.4
    removed 6 packages, updated 1 package and audited 3656 packages in 20.075s
    found 50 vulnerabilities (16 low, 18 moderate, 16 high)
    run npm audit fix to fix them, or npm audit for details

then npm install

PS C:\Users\balup\Documents\source\repos\Documentation> npm install
npm WARN grunt-contrib-clean@0.6.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-contrib-watch@0.6.1 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-execute@0.2.2 requires a peer of grunt@~0.4.1 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-express-server@0.4.19 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-http-download@0.1.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package extend is included as both a dev and production dependency.
npm WARN The package lodash is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

audited 3656 packages in 7.784s
found 50 vulnerabilities (16 low, 18 moderate, 16 high)
run npm audit fix to fix them, or npm audit for details

next

PS C:\Users\balup\Documents\source\repos\Documentation> npm install -g grunt-cli
C:\Users\balup\AppData\Roaming\npm\grunt → C:\Users\balup\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt

  • grunt-cli@1.3.2
    updated 1 package in 6.957s

now do grunt build

PS C:\Users\balup\Documents\source\repos\Documentation> grunt build
Running “clean:json” (clean) task

5 paths cleaned.

Running “download:documentation” (download) task
Downloading https://cdn.jsdelivr.net/gh/BabylonJS/Babylon.js@master/dist/preview%20release/documentation.d.ts to ./typedoc/babylon.d.ts …
Finished downloading https://cdn.jsdelivr.net/gh/BabylonJS/Babylon.js@master/dist/preview%20release/documentation.d.ts.

Running “typedoc:build” (typedoc) task

Using TypeScript 3.2.4 from C:\Users\balup\Documents\source\repos\Documentation\node_modules\typedoc\node_modules\typescript\lib
Rendering [========================================] 100%

Documentation generated at C:\Users\balup\Documents\source\repos\Documentation\public\html\api

Running “execute:compileIndex” (execute) task
→ executing module C:\Users\balup\Documents\source\repos\Documentation\scripts\compile-html\compile-html-index.js
2019-05-21T08:44:04.784Z - info: > Index.html compiled.
2019-05-21T08:44:04.913Z - info: > Playground.html compiled.
2019-05-21T08:44:05.028Z - info: > search.html compiled.
2019-05-21T08:44:05.031Z - info: > api.html compiled.
→ completed C:\Users\balup\Documents\source\repos\Documentation\scripts\compile-html\compile-html-index.js (734ms)

1 file and 0 calls executed (1381ms)

Running “execute:compileExamples” (execute) task
→ module call undefined
2019-05-21T08:44:05.930Z - info: > examples.html compiled.
→ completed (892ms)

0 files and 1 call executed (895ms)

Running “copy:exampleIcons” (copy) task
Created 1 directory, copied 133 files

Running “execute:compileWhatsNew” (execute) task
→ executing module C:\Users\balup\Documents\source\repos\Documentation\scripts\compile-html\compile-html-whats-new.js
2019-05-21T08:44:07.459Z - info: > Whats-new.html compiled.
→ completed C:\Users\balup\Documents\source\repos\Documentation\scripts\compile-html\compile-html-whats-new.js (228ms)

1 file and 0 calls executed (309ms)

Running “execute:compileHtmlStatics” (execute) task
→ module call undefined
Fatal error: primordials is not defined

Execution Time (2019-05-21 20:43:25 UTC+12)
loading tasks 742ms ███ 2%
typedoc:build 36.7s ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 87%
execute:compileIndex 1.4s ██████ 3%
execute:compileExamples 899ms ████ 2%
copy:exampleIcons 1.2s █████ 3%
Total 42s

This is where I notice the “Fatal error: primordials is not defined” error.

I think I am going to directly modify on web and rely on my superpower of doing it right the first time :slight_smile:

Regards,
Balu

can you make sure you are on node 8+?

Also it could be worth deleting the entire folder and restarting from scratch :slight_smile:

The one thing I forgot to tell @balupg to check - the node version.

I am using

$ node -v
v10.15.0

Yes. Tried a few times with fresh clone. No luck.

node version is 12.2. Maybe that could be the reason?

PS C:\Users\balup\Documents\source\repos\Documentation> node -v
v12.2.0

yup it might, I have been unlucky in some projects with 12 :frowning:

Did you finaly found a solution ?

I’m facing the same issue today :

  • node v14.7.0
  • grunt-cli v1.3.2
  • grunt v1.2.1

@RaananW will work on the new doc page soon and will remove the need for node 10

1 Like

Just showing how important LTS tooling is :slight_smile:

And backwards compatibility!

Anyhow - it will soon be different :slight_smile:

1 Like

Man!