1

I can't seem to figure out how to install the documents for offline use. I wanted to download them to an external drive d:. I used Phaser GitHub and went to the D: drive and created a folder called phaser and then cloned the GitHub repo.

Now I have D:\phaser\phaser.

I also installed jsDocs using npm install -g jsdoc and it was installed at C:\Users\jfire\AppData\Roaming\npm\node_modules\jsdoc

How do I now use jsDocs to show the phaser documents? I tried running npm run gen from the D:\phaser\phaser folder but get this error

$ npm run gen
npm ERR! missing script: gen

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jfire\AppData\Roaming\npm-cache\_logs\2021-07-16T23_58_11_318Z-debug.log

I'm not really sure how this kind of stuff works but need to get these documents available offline for viewing. Any help would be appreciated.

Adding error code from npm install

jfire@DESKTOP-FOR4DMS MINGW64 /d/phaser/phaser (master)
$ npm install
npm WARN tar EINVAL: invalid argument, futime
npm WARN tar EINVAL: invalid argument, futime
npm WARN tar EINVAL: invalid argument, futime
npm WARN tar EINVAL: invalid argument, futime
npm WARN tar EINVAL: invalid argument, futime
npm WARN tar EINVAL: invalid argument, futime
npm WARN tar EINVAL: invalid argument, futime
npm WARN tar EINVAL: invalid argument, futime
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path D:\phaser\phaser\node_modules\@babel\parser
npm ERR! dest D:\phaser\phaser\node_modules\@babel\.parser.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'D:\phaser\phaser\node_modules\@babel\parser' -> 'D:\phaser\phaser\node_modules\@babel\.parser.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jfire\AppData\Roaming\npm-cache\_logs\2021-07-17T01_44_36_990Z-debug.log

James Skemp
  • 8,018
  • 9
  • 64
  • 107
Justin
  • 2,873
  • 3
  • 9
  • 16

1 Answers1

0

You would need npm install (without parameter) in order to install the scripts declared in package.json, with the node_modules/.bin folder in the path.

Then npm run gen would run the gen script.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So I did that from the `D:\phaser\phaser folder. I added my errors to my question. I also ran `npm install` from the jsDocs folder which created a `.bin` folder but still not sure what to do. – Justin Jul 17 '21 at 02:29
  • @Justin If you see a `gen` script in the `.bin` folder, make sure the full path of that folder is included in your `%PATH%` environment variable. – VonC Jul 17 '21 at 02:51
  • in the `.bin` folder are threee files `jsdoc` `jsdoc.cmd` and `jsdoc.ps1`. I don't see a `gen` script. Unless its one of those. – Justin Jul 17 '21 at 03:05
  • @Justin If the `.bin` is in your `%PATH%`, test what a `npm run gen` would give you. See also https://stackoverflow.com/a/57082990/6309. – VonC Jul 17 '21 at 03:10
  • By running `echo $PATH | tr ":" "\n"` I get a list of directories in my PATH to include these two `/Users/jfire/AppData/Roaming/npm/node_modules/jsdoc` and `/Users/jfire/AppData/Roaming/npm/node_modules/.bin`. However using `npm run gen` just gives the `npm ERR! missing script: gen` error – Justin Jul 17 '21 at 03:55
  • @Justin OK. Strange, considering your `package.json` does define the gen function: https://github.com/photonstorm/phaser3-docs/blob/3bc4ffd72a41aad32b6c8713bb73abda063ecf81/package.json#L9 – VonC Jul 17 '21 at 12:24
  • Ok so I never cloned the docs from the phaser3-docs github. I only cloned the phaser3 github. Now I have cloned the docs and then I put the `phaser` folder in the root of `phaser3-docs`. Now it looks like `D:\phaser\phaser3-docs\phaser`. I also was getting python errors so I installed Python. Then I was getting Visual Studio Errors so I installed Visual Studios. Then I was getting some kind of VS v140 error so I installed that too. I finally was able to run `npm install` from the `D:\phaser\phaser3-docs` path without error. Now I still can't run `npm run gen` though. Extremely frustrating. – Justin Jul 17 '21 at 16:32