Skip to content

Commit c3e5487

Browse files
cclaussrvagg
authored andcommitted
doc(wiki): Improve Unix instructions
1 parent 0fce46b commit c3e5487

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

Updating-npm's-bundled-node-gyp.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,23 @@ _won't_ do the trick since npm will still continue to use its internal copy over
99

1010
So instead:
1111

12+
## Version of npm
13+
14+
We need to start by knowing your version of `npm`:
15+
```bash
16+
npm --version
17+
```
18+
1219
## Linux, Mac OS X, Solaris, etc.
1320

1421
Unix is easy. Just run the following command. Use `sudo` if necessary.
22+
23+
If your npm is version ___7___, do:
24+
```bash
25+
$ [sudo] npm explore npm/node_modules/@npmcli/run-script -g -- npm_config_global=false npm install node-gyp@latest
26+
```
27+
28+
Else if your npm is version ___less than 7___, do:
1529
```bash
1630
$ [sudo] npm explore npm/node_modules/npm-lifecycle -g -- npm install node-gyp@latest
1731
```
@@ -26,17 +40,12 @@ First we need to find the location of `node`. If you don't already know the loca
2640
$ where node
2741
```
2842

29-
Now `cd` to the directory that `node.exe` is contained in i.e.:
43+
Now `cd` to the directory that `node.exe` is contained in e.g.:
3044
```bash
3145
$ cd "C:\Program Files\nodejs"
3246
```
3347

34-
Now we need to know your version of `npm`:
35-
```bash
36-
npm --version
37-
```
38-
39-
If your npm version is ___7 or greater___, do:
48+
If your npm version is ___7___, do:
4049
```bash
4150
cd node_modules\npm\node_modules\@npmcli\run-script
4251
```

0 commit comments

Comments
 (0)