Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6789663

Browse filesBrowse files
MylesBorinsgibfahn
authored andcommitted
doc: add guide to maintaining npm
This is based on the guide found on their wiki refs: https://github.com/npm/npm/wiki/CLI-Team-Process#submitting-the-new-latest-x-to-nodejs PR-URL: #16541 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent 4155216 commit 6789663
Copy full SHA for 6789663

File tree

Expand file treeCollapse file tree

1 file changed

+68
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+68
-0
lines changed
Open diff view settings
Collapse file

‎doc/guides/maintaining-npm.md‎

Copy file name to clipboard
+68Lines changed: 68 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Maintaining npm in Node.js
2+
3+
## Step 1: Clone npm
4+
5+
```console
6+
$ git clone https://github.com/npm/npm.git
7+
$ cd npm
8+
```
9+
10+
or if you already have npm cloned make sure the repo is up to date
11+
12+
```console
13+
$ git remote update -p
14+
$ git reset --hard origin latest
15+
```
16+
17+
## Step 2: Build release
18+
19+
```console
20+
$ git checkout vX.Y.Z
21+
$ make release
22+
```
23+
24+
Note: please run `npm dist-tag ls npm` and make sure this is the `latest` **dist-tag**. `latest` on git is usually released as `next` when it's time to downstream
25+
26+
## Step 3: Remove old npm
27+
28+
```console
29+
$ cd /path/to/node
30+
$ git remote update -p
31+
$ git checkout -b npm-x.y.z origin/master
32+
$ cd deps
33+
$ rm -rf npm
34+
```
35+
36+
## Step 4: Extract and commit new npm
37+
38+
```console
39+
$ tar zxf /path/to/npm/release/npm-x.y.z.tgz
40+
$ git add -A npm
41+
$ git commit -m "deps: upgrade npm to x.y.z"
42+
$ cd ..
43+
```
44+
45+
## Step 5: Update licenses
46+
47+
```console
48+
$ ./configure
49+
$ make -j4
50+
$ ./tools/license-builder.sh
51+
# The following commands are only necessary if there are changes
52+
$ git add .
53+
$ git commit -m "doc: update npm LICENSE using license-builder.sh"
54+
```
55+
56+
Note: please ensure you are only making the updates that are changed by npm.
57+
58+
## Step 6: Apply Whitespace fix
59+
60+
```console
61+
$ git rebase --whitespace=fix master
62+
```
63+
64+
## Step 7: Test the build
65+
66+
```console
67+
$ make test-npm
68+
```

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.