@@ -5,49 +5,57 @@ title: Installation
5
5
6
6
# Prerequisites
7
7
8
- ` node.js ` (` npm ` included) required, please follow the installation guide :
8
+ Install the latest LTS version of ` node.js ` (` npm ` included):
9
9
10
10
* [ Install from package manager] ( https://nodejs.org/en/download/package-manager/ )
11
11
* [ Install from directly download] ( https://nodejs.org/en/download/ )
12
12
13
- Please install the latest LTS version on the list above.
14
-
15
- Then verify the result:
13
+ Check before going next:
16
14
17
15
$ node -v
18
16
$ npm -v
19
17
20
18
# Installation
21
19
22
- Choose one of the following ways to install leetcode-cli:
20
+ There are different ways to install ` leetcode-cli ` :
23
21
24
22
### From npm
25
23
26
- This will install the latest stable version, but not include the latest development version.
24
+ This will install the latest STABLE version, but not include the latest DEV version.
27
25
28
26
$ npm install -g leetcode-cli
27
+ $ leetcode version
29
28
30
- In case Ubuntu failed due to ` permission denied ` , run following and try again :
29
+ In case Ubuntu failed due to ** permission denied** , try following :
31
30
32
31
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
33
32
$ source ~/.bashrc
34
33
$ nvm install --lts
35
34
36
- See more details [ here] ( https://docs.npmjs.com/getting-started/fixing-npm-permissions ) .
35
+ Find more details [ here] ( https://docs.npmjs.com/getting-started/fixing-npm-permissions ) .
37
36
38
37
### From GitHub
39
38
40
- This will install the latest development version on GitHub.
39
+ This will install the latest DEV version from GitHub repo .
41
40
42
41
$ npm install -g skygragon/leetcode-cli
42
+ $ leetcode version
43
43
44
- ### From local source
44
+ ### From source
45
45
46
46
Similar with above, while you can introduce your own changes as you wish.
47
47
48
48
$ git clone http://github.com/skygragon/leetcode-cli
49
49
$ cd leetcode-cli && ./bin/install
50
+ $ leetcode version
51
+
52
+ ### From docker
50
53
51
- Then verify the result:
54
+ NOTE: This is just a tiny taste to let you feel that leetcode-cli is. Please use other ways above to install leetcode-cli if you like it.
52
55
56
+ $ alias leetcode='docker run -it --rm skygragon/leetcode-cli'
53
57
$ leetcode version
58
+
59
+ To persistent user data, you can mount a folder like this:
60
+
61
+ $ alias leetcode='docker run -it --rm -v /Users/skygragon/data:/root skygragon/leetcode-cli'
0 commit comments