From e100e6fd4f92794a88bbcf06da23baad289b10dc Mon Sep 17 00:00:00 2001 From: Fabio Rocha Date: Fri, 15 Jul 2022 09:21:14 +0000 Subject: [PATCH] Added note about katex install for building docs (#81550) Currently, the version of katex that npm installs and the version of nodejs that is installed by conda from conda-forge are incompatible. This note describes which version of katex to install to avoid this Pull Request resolved: https://github.com/pytorch/pytorch/pull/81550 Approved by: https://github.com/Lezcano, https://github.com/kit1980 --- CONTRIBUTING.md | 8 ++++++++ README.md | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20ee44b2ee0..0bf34362d1e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -467,12 +467,20 @@ pip install -r requirements.txt # Or if you prefer an uncontaminated global executable environment or do not want to go through the node configuration: # npm install katex && export PATH="$PATH:$(pwd)/node_modules/.bin" ``` +> Note: if you installed `nodejs` with a different package manager (e.g., +`conda`) then `npm` will probably install a version of `katex` that is not +compatible with your version of `nodejs` and doc builds will fail. +A combination of versions that is known to work is `node@6.13.1` and +`katex@0.13.18`. To install the latter with `npm` you can run +```npm install -g katex@0.13.18``` + > Note that if you are a Facebook employee using a devserver, yarn may be more convenient to install katex: ```bash yarn global add katex ``` +> If a specific version is required you can use for example `yarn global add katex@0.13.18`. 3. Generate the documentation HTML files. The generated files will be in `docs/build/html`. diff --git a/README.md b/README.md index ad71c42cbcc..49f5f534c0e 100644 --- a/README.md +++ b/README.md @@ -380,6 +380,13 @@ You can then build the documentation by running `make ` from the If you get a katex error run `npm install katex`. If it persists, try `npm install -g katex` +> Note: if you installed `nodejs` with a different package manager (e.g., +`conda`) then `npm` will probably install a version of `katex` that is not +compatible with your version of `nodejs` and doc builds will fail. +A combination of versions that is known to work is `node@6.13.1` and +`katex@0.13.18`. To install the latter with `npm` you can run +```npm install -g katex@0.13.18``` + ### Previous Versions Installation instructions and binaries for previous PyTorch versions may be found