From 6287118fc4407edfeda1d092c58f848d23bd6c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Sat, 19 Dec 2020 18:53:43 +0530 Subject: [PATCH] doc: updated README.md to copy easily (#2281) PR-URL: https://github.com/nodejs/node-gyp/pull/2281 Reviewed-By: Jiawen Geng --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e06b01a739..64e82dbbe3 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ etc.), regardless of what version of Node.js is actually installed on your syste You can install `node-gyp` using `npm`: ``` bash -$ npm install -g node-gyp +npm install -g node-gyp ``` Depending on your operating system, you will need to install: @@ -71,7 +71,7 @@ version `node-gyp` should use in one of the following ways: 1. by setting the `--python` command-line option, e.g.: ``` bash -$ node-gyp --python /path/to/executable/python +node-gyp --python /path/to/executable/python ``` 2. If `node-gyp` is called by way of `npm`, *and* you have multiple versions of @@ -79,7 +79,7 @@ Python installed, then you can set `npm`'s 'python' config key to the appropriat value: ``` bash -$ npm config set python /path/to/executable/python +npm config set python /path/to/executable/python ``` 3. If the `PYTHON` environment variable is set to the path of a Python executable, @@ -95,20 +95,20 @@ searching will be done. To compile your native addon, first go to its root directory: ``` bash -$ cd my_node_addon +cd my_node_addon ``` The next step is to generate the appropriate project build files for the current platform. Use `configure` for that: ``` bash -$ node-gyp configure +node-gyp configure ``` Auto-detection fails for Visual C++ Build Tools 2015, so `--msvs_version=2015` needs to be added (not needed when run by npm as configured above): ``` bash -$ node-gyp configure --msvs_version=2015 +node-gyp configure --msvs_version=2015 ``` __Note__: The `configure` step looks for a `binding.gyp` file in the current @@ -118,7 +118,7 @@ Now you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file (on Windows) in the `build/` directory. Next, invoke the `build` command: ``` bash -$ node-gyp build +node-gyp build ``` Now you have your compiled `.node` bindings file! The compiled bindings end up @@ -214,13 +214,13 @@ For example, to set `devdir` equal to `/tmp/.gyp`, you would: Run this on Unix: ```bash -$ export npm_config_devdir=/tmp/.gyp +export npm_config_devdir=/tmp/.gyp ``` Or this on Windows: ```console -> set npm_config_devdir=c:\temp\.gyp +set npm_config_devdir=c:\temp\.gyp ``` ### `npm` configuration @@ -230,7 +230,7 @@ Use the form `OPTION_NAME` for any of the command options listed above. For example, to set `devdir` equal to `/tmp/.gyp`, you would run: ```bash -$ npm config set [--global] devdir /tmp/.gyp +npm config set [--global] devdir /tmp/.gyp ``` **Note:** Configuration set via `npm` will only be used when `node-gyp`