Skip to content

Commit 1cc6df2

Browse files
bzozMylesBorins
authored andcommitted
tools: add Boxstarter script
Adds a Boxstarter script for easy Node.js building prerequisites installation PR-URL: #17046 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 8bd74c4 commit 1cc6df2

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

BUILDING.md

+3
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ Depending on host platform, the selection of toolchains may vary.
8989

9090
## Building Node.js on supported platforms
9191

92+
*Note:* All prerequisites can be easily installed by following
93+
[this bootstrapping guide](https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md).
94+
9295
### Unix / macOS
9396

9497
Prerequisites:

tools/bootstrap/README.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Node.js Bootstrapping Guide
2+
3+
## Windows
4+
5+
A [Boxstarter][] script can be used for easy setup of Windows systems with all
6+
the required prerequisites for Node.js development. This script will install
7+
the following [Chocolatey] packages:
8+
* [Git for Windows][] with the `git` and Unix tools added to the `PATH`
9+
* [Python 2.x][]
10+
* [Visual Studio 2017 Build Tools][] with [Visual C++ workload][]
11+
12+
To install Node.js prerequisites using [Boxstarter WebLauncher][], just open
13+
[this link](http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter)
14+
with Internet Explorer or Edge browser on the target machine.
15+
16+
Alternatively, you can use PowerShell. Run those commands from an elevated
17+
PowerShell terminal:
18+
```console
19+
Set-ExecutionPolicy Unrestricted -Force
20+
iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1'))
21+
get-boxstarter -Force
22+
Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter -DisableReboots
23+
```
24+
25+
Entire installation will take up about 8 GB of disk space.
26+
27+
## Linux
28+
29+
For building Node.js on Linux, following packages are required (note, that this
30+
can vary from distribution to distribution):
31+
* `git`
32+
* `python`
33+
* `gcc-c++` or `g++`
34+
* `make`
35+
36+
To bootstrap Node.js on Linux, run in terminal:
37+
* OpenSUSE: `sudo zypper install git python gcc-c++ make`
38+
* Fedora: `sudo dnf install git python gcc-c++ make`
39+
* Ubuntu, Debian: `sudo apt-get install git python g++ make`
40+
41+
## macOS
42+
43+
To install required tools on macOS, run in terminal:
44+
```console
45+
xcode-select --install
46+
```
47+
48+
[Boxstarter]: http://boxstarter.org/
49+
[Boxstarter WebLauncher]: http://boxstarter.org/WebLauncher
50+
[Chocolatey]: https://chocolatey.org/
51+
[Git for Windows]: https://chocolatey.org/packages/git
52+
[Python 2.x]: https://chocolatey.org/packages/python2
53+
[Visual Studio 2017 Build Tools]: https://chocolatey.org/packages/visualstudio2017buildtools
54+
[Visual C++ workload]: https://chocolatey.org/packages/visualstudio2017-workload-vctools
55+

tools/bootstrap/windows_boxstarter

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Boxstarter (http://boxstarter.org/) script for Node.js prerequisites
2+
#
3+
# To install either open this link in IE or Edge:
4+
# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter
5+
#
6+
# Or run those commands in an elevated Powershell terminal:
7+
# iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1'))
8+
# get-boxstarter -Force
9+
# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter -DisableReboots
10+
#
11+
# For more detail see
12+
# https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md
13+
#
14+
15+
# Git and Unix tools will be added to the PATH
16+
choco install git -params /GitAndUnixToolsOnPath -y
17+
choco install python2 -y
18+
19+
# Installs VS 2017 Build Tools
20+
choco install visualstudio2017buildtools -y
21+
choco install visualstudio2017-workload-vctools -y

0 commit comments

Comments
 (0)