Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating-npm-bundled-node-gyp.md: npm is currently v10 #2970

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions docs/Updating-npm-bundled-node-gyp.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This means that while `node-gyp` doesn't get installed into your `$PATH` by defa
attempt to `npm install` a native add-on.

Sometimes, you may need to update npm's internal node-gyp to a newer version than what is installed. A simple `npm install -g node-gyp`
_won't_ do the trick since npm will still continue to use its internal copy over the global one.
_won't_ do the trick since npm will continue to use its internal copy over the global one.

So instead:

Expand All @@ -29,7 +29,7 @@ npm --version

Unix is easy. Just run the following command.

If your npm is version ___7 or 8___, do:
If your npm is version ___7 or higher___, do:
```bash
$ npm explore npm/node_modules/@npmcli/run-script -g -- npm_config_global=false npm install node-gyp@latest
```
Expand All @@ -43,10 +43,9 @@ If the command fails with a permissions error, please try `sudo` and then the co

## Windows

Windows is a bit trickier, since `npm` might be installed to the "Program Files" directory, which needs admin privileges in order to
modify on current Windows. Therefore, run the following commands __inside a `cmd.exe` started with "Run as Administrator"__:
Windows is a bit trickier, since `npm` might be installed in the "Program Files" directory, which needs admin privileges to modify current Windows. Therefore, run the following commands __inside a `cmd.exe` started with "Run as Administrator"__:

First we need to find the location of `node`. If you don't already know the location that `node.exe` got installed to, then run:
First, we need to find the location of `node`. If you don't already know the location that `node.exe` got installed to, then run:
```bash
$ where node
```
Expand All @@ -56,7 +55,7 @@ Now `cd` to the directory that `node.exe` is contained in e.g.:
$ cd "C:\Program Files\nodejs"
```

If your npm version is ___7 or 8___, do:
If your npm version is ___7 or higher___, do:
```bash
cd node_modules\npm\node_modules\@npmcli\run-script
```
Expand Down