From 2c7577bc99372e98310d422e4e3f9cc2cf813599 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 14 Nov 2017 15:57:11 +0100 Subject: [PATCH 1/4] tools: add Boxstarter script Adds a Boxstarter script for easy Node.js building prerequisites installation --- BUILDING.md | 3 ++ tools/boxstarter/README.md | 54 +++++++++++++++++++++++++ tools/boxstarter/node_boxstarter | 21 ++++++++++ tools/boxstarter/node_boxstarter_vscode | 25 ++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 tools/boxstarter/README.md create mode 100644 tools/boxstarter/node_boxstarter create mode 100644 tools/boxstarter/node_boxstarter_vscode diff --git a/BUILDING.md b/BUILDING.md index 52c11aa08e9adf..a841f7a9e560d7 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -202,6 +202,9 @@ Prerequisites: [Git for Windows](http://git-scm.com/download/win) includes Git Bash and tools which can be included in the global `PATH`. +*Note:* All prerequisites can be easily installed by following +[this Boxstarter guide](https://github.com/nodejs/node/blob/master/tools/boxstarter/README.md). + If the path to your build directory contains a space, the build will likely fail. ```console diff --git a/tools/boxstarter/README.md b/tools/boxstarter/README.md new file mode 100644 index 00000000000000..9acc0146c65c11 --- /dev/null +++ b/tools/boxstarter/README.md @@ -0,0 +1,54 @@ +# Boxstarter setup for Node.js + +A [Boxstarter][] script can be used for an easy setup of Windows systems with all +the required prerequisites for Node.js development. This script will install +the following [Chocolatey] packages: + * [Git for Windows][] with the `git` and Unix tools added to the `PATH` + * [Python 2.x][] + * [Visual Studio 2017 Build Tools][] with [Visual C++ workload][] + * Optionally: [Visual Studio Code][] e.g. when setting up Code and Learn boxes + +## WebLauncher Installation + +To install Node.js prerequisites using [Boxstarter WebLauncher][], just open +**one** of the following links with Internet Explorer or Edge browser on the +target machine: + * [Node.js prerequisites][] + * [Node.js prerequisites with VS Code][] + +## PowerShell Installation + +To install the Node.js prerequisites using PowerShell, first install Boxstarter: + + * From PowerShell v2 (Windows 7, Windows Server 2008): +```console +iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')); get-boxstarter -Force +``` + + * From PowerShell v3 (newer Windows systems): +```console +. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force +``` + +After Boxstarter has been successfully installed, run: + + * For Node.js prerequisites: +```console +Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter -DisableReboots +``` + + * For Node.js prerequisites with VS Code: +```console +Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode -DisableReboots +``` + +[Boxstarter]: http://boxstarter.org/ +[Boxstarter WebLauncher]: http://boxstarter.org/WebLauncher +[Chocolatey]: https://chocolatey.org/ +[Git for Windows]: https://chocolatey.org/packages/git +[Python 2.x]: https://chocolatey.org/packages/python2 +[Visual Studio 2017 Build Tools]: https://chocolatey.org/packages/visualstudio2017buildtools +[Visual C++ workload]: https://chocolatey.org/packages/visualstudio2017-workload-vctools +[Visual Studio Code]: https://chocolatey.org/packages/visualstudiocode +[Node.js prerequisites]: http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter +[Node.js prerequisites with VS Code]: http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode diff --git a/tools/boxstarter/node_boxstarter b/tools/boxstarter/node_boxstarter new file mode 100644 index 00000000000000..7bd5852ca5dd2c --- /dev/null +++ b/tools/boxstarter/node_boxstarter @@ -0,0 +1,21 @@ +# Boxstarter (http://boxstarter.org/) script for Node.js prerequisites +# +# To install either open this link in IE or Edge: +# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter +# +# Or run those commands in a Powershell terminal: +# iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')) +# get-boxstarter -Force +# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter -DisableReboots +# +# For more detail see +# https://github.com/nodejs/node/blob/master/tools/boxstarter/README.md +# + +# Git and Unix tools will be added to the PATH +choco install git -params /GitAndUnixToolsOnPath -y +choco install python2 -y + +# Installs VS 2017 Build Tools +choco install visualstudio2017buildtools -y +choco install visualstudio2017-workload-vctools -y diff --git a/tools/boxstarter/node_boxstarter_vscode b/tools/boxstarter/node_boxstarter_vscode new file mode 100644 index 00000000000000..6401692f9e91ed --- /dev/null +++ b/tools/boxstarter/node_boxstarter_vscode @@ -0,0 +1,25 @@ +# Boxstarter (http://boxstarter.org/) script for Node.js prerequisites, +# including Visual Studio Code +# +# To install either open this link in IE or Edge: +# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode +# +# Or run those commands in a Powershell terminal: +# iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')) +# get-boxstarter -Force +# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode -DisableReboots +# +# For more detail see +# https://github.com/nodejs/node/blob/master/tools/boxstarter/README.md +# + +# Git and Unix tools will be added to the PATH +choco install git -params /GitAndUnixToolsOnPath -y +choco install python2 -y + +# Installs VS 2017 Build Tools +choco install visualstudio2017buildtools -y +choco install visualstudio2017-workload-vctools -y + +# Installs Visual Studio Code +choco install visualstudiocode -y From d593ad7baf8d53d04eba15a86d2e0c9d2f1a2a88 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Thu, 16 Nov 2017 14:48:39 +0100 Subject: [PATCH 2/4] fixup: remove vscode, rename to bootstrap --- BUILDING.md | 2 +- tools/bootstrap/README.md | 32 +++++++++++ .../windows_boxstarter} | 8 +-- tools/boxstarter/README.md | 54 ------------------- tools/boxstarter/node_boxstarter_vscode | 25 --------- 5 files changed, 37 insertions(+), 84 deletions(-) create mode 100644 tools/bootstrap/README.md rename tools/{boxstarter/node_boxstarter => bootstrap/windows_boxstarter} (71%) delete mode 100644 tools/boxstarter/README.md delete mode 100644 tools/boxstarter/node_boxstarter_vscode diff --git a/BUILDING.md b/BUILDING.md index a841f7a9e560d7..61ffd68388d0f2 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -203,7 +203,7 @@ Prerequisites: and tools which can be included in the global `PATH`. *Note:* All prerequisites can be easily installed by following -[this Boxstarter guide](https://github.com/nodejs/node/blob/master/tools/boxstarter/README.md). +[this bootstrapping guide](https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md#Windows). If the path to your build directory contains a space, the build will likely fail. diff --git a/tools/bootstrap/README.md b/tools/bootstrap/README.md new file mode 100644 index 00000000000000..00b333d8cfe18f --- /dev/null +++ b/tools/bootstrap/README.md @@ -0,0 +1,32 @@ +# Node.js Bootstrapping Guide + +## Windows + +A [Boxstarter][] script can be used for easy setup of Windows systems with all +the required prerequisites for Node.js development. This script will install +the following [Chocolatey] packages: + * [Git for Windows][] with the `git` and Unix tools added to the `PATH` + * [Python 2.x][] + * [Visual Studio 2017 Build Tools][] with [Visual C++ workload][] + +To install Node.js prerequisites using [Boxstarter WebLauncher][], just open +[this link](http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter) +with Internet Explorer or Edge browser on the target machine. + +Alternatively, you can use PowerShell. Run those commands from an elevated +PowerShell terminal: +```console +Set-ExecutionPolicy Unrestricted -Force +iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')) +get-boxstarter -Force +Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter -DisableReboots +``` + +[Boxstarter]: http://boxstarter.org/ +[Boxstarter WebLauncher]: http://boxstarter.org/WebLauncher +[Chocolatey]: https://chocolatey.org/ +[Git for Windows]: https://chocolatey.org/packages/git +[Python 2.x]: https://chocolatey.org/packages/python2 +[Visual Studio 2017 Build Tools]: https://chocolatey.org/packages/visualstudio2017buildtools +[Visual C++ workload]: https://chocolatey.org/packages/visualstudio2017-workload-vctools + diff --git a/tools/boxstarter/node_boxstarter b/tools/bootstrap/windows_boxstarter similarity index 71% rename from tools/boxstarter/node_boxstarter rename to tools/bootstrap/windows_boxstarter index 7bd5852ca5dd2c..144c309ae11ad0 100644 --- a/tools/boxstarter/node_boxstarter +++ b/tools/bootstrap/windows_boxstarter @@ -1,15 +1,15 @@ # Boxstarter (http://boxstarter.org/) script for Node.js prerequisites # # To install either open this link in IE or Edge: -# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter +# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter # -# Or run those commands in a Powershell terminal: +# Or run those commands in an elevated Powershell terminal: # iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')) # get-boxstarter -Force -# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter -DisableReboots +# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter -DisableReboots # # For more detail see -# https://github.com/nodejs/node/blob/master/tools/boxstarter/README.md +# https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md # # Git and Unix tools will be added to the PATH diff --git a/tools/boxstarter/README.md b/tools/boxstarter/README.md deleted file mode 100644 index 9acc0146c65c11..00000000000000 --- a/tools/boxstarter/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Boxstarter setup for Node.js - -A [Boxstarter][] script can be used for an easy setup of Windows systems with all -the required prerequisites for Node.js development. This script will install -the following [Chocolatey] packages: - * [Git for Windows][] with the `git` and Unix tools added to the `PATH` - * [Python 2.x][] - * [Visual Studio 2017 Build Tools][] with [Visual C++ workload][] - * Optionally: [Visual Studio Code][] e.g. when setting up Code and Learn boxes - -## WebLauncher Installation - -To install Node.js prerequisites using [Boxstarter WebLauncher][], just open -**one** of the following links with Internet Explorer or Edge browser on the -target machine: - * [Node.js prerequisites][] - * [Node.js prerequisites with VS Code][] - -## PowerShell Installation - -To install the Node.js prerequisites using PowerShell, first install Boxstarter: - - * From PowerShell v2 (Windows 7, Windows Server 2008): -```console -iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')); get-boxstarter -Force -``` - - * From PowerShell v3 (newer Windows systems): -```console -. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force -``` - -After Boxstarter has been successfully installed, run: - - * For Node.js prerequisites: -```console -Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter -DisableReboots -``` - - * For Node.js prerequisites with VS Code: -```console -Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode -DisableReboots -``` - -[Boxstarter]: http://boxstarter.org/ -[Boxstarter WebLauncher]: http://boxstarter.org/WebLauncher -[Chocolatey]: https://chocolatey.org/ -[Git for Windows]: https://chocolatey.org/packages/git -[Python 2.x]: https://chocolatey.org/packages/python2 -[Visual Studio 2017 Build Tools]: https://chocolatey.org/packages/visualstudio2017buildtools -[Visual C++ workload]: https://chocolatey.org/packages/visualstudio2017-workload-vctools -[Visual Studio Code]: https://chocolatey.org/packages/visualstudiocode -[Node.js prerequisites]: http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter -[Node.js prerequisites with VS Code]: http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode diff --git a/tools/boxstarter/node_boxstarter_vscode b/tools/boxstarter/node_boxstarter_vscode deleted file mode 100644 index 6401692f9e91ed..00000000000000 --- a/tools/boxstarter/node_boxstarter_vscode +++ /dev/null @@ -1,25 +0,0 @@ -# Boxstarter (http://boxstarter.org/) script for Node.js prerequisites, -# including Visual Studio Code -# -# To install either open this link in IE or Edge: -# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode -# -# Or run those commands in a Powershell terminal: -# iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')) -# get-boxstarter -Force -# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode -DisableReboots -# -# For more detail see -# https://github.com/nodejs/node/blob/master/tools/boxstarter/README.md -# - -# Git and Unix tools will be added to the PATH -choco install git -params /GitAndUnixToolsOnPath -y -choco install python2 -y - -# Installs VS 2017 Build Tools -choco install visualstudio2017buildtools -y -choco install visualstudio2017-workload-vctools -y - -# Installs Visual Studio Code -choco install visualstudiocode -y From d186a44aee7457f3bb66bec3f7909043e66b4cef Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Wed, 22 Nov 2017 14:47:10 +0100 Subject: [PATCH 3/4] fixup: move link in BUILDING.md up, add Linux instructions --- BUILDING.md | 6 +++--- tools/bootstrap/README.md | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 61ffd68388d0f2..183d37cf6377ff 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -81,6 +81,9 @@ Depending on host platform, the selection of toolchains may vary. ## Building Node.js on supported platforms +*Note:* All prerequisites can be easily installed by following +[this bootstrapping guide](https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md). + ### Unix / macOS Prerequisites: @@ -202,9 +205,6 @@ Prerequisites: [Git for Windows](http://git-scm.com/download/win) includes Git Bash and tools which can be included in the global `PATH`. -*Note:* All prerequisites can be easily installed by following -[this bootstrapping guide](https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md#Windows). - If the path to your build directory contains a space, the build will likely fail. ```console diff --git a/tools/bootstrap/README.md b/tools/bootstrap/README.md index 00b333d8cfe18f..5bbc9494ea9c54 100644 --- a/tools/bootstrap/README.md +++ b/tools/bootstrap/README.md @@ -22,6 +22,20 @@ get-boxstarter -Force Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter -DisableReboots ``` +## Linux + +For building Node.js on Linux, following packets are required (note, that this +can vary from distribution to distribution): + * `git-core` + * `python` + * `gcc-c++` or `g++` + * `make` + +To bootstrap Node.js on Linux, run in terminal: + * OpenSUSE: `sudo zypper install git-core python gcc-c++ make` + * Fedora: `sudo dnf install git-core python gcc-c++ make` + * Ubuntu, Debian: `sudo apt-get install git-core python g++ make` + [Boxstarter]: http://boxstarter.org/ [Boxstarter WebLauncher]: http://boxstarter.org/WebLauncher [Chocolatey]: https://chocolatey.org/ From f75e18c60abe22e6038d196e8dc14d7fef46b633 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 28 Nov 2017 14:45:03 +0100 Subject: [PATCH 4/4] fixup: chagnge git-core to core, add macOS and windows disk space --- tools/bootstrap/README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/bootstrap/README.md b/tools/bootstrap/README.md index 5bbc9494ea9c54..a61e947a2af0b4 100644 --- a/tools/bootstrap/README.md +++ b/tools/bootstrap/README.md @@ -22,19 +22,28 @@ get-boxstarter -Force Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter -DisableReboots ``` +Entire installation will take up about 8 GB of disk space. + ## Linux -For building Node.js on Linux, following packets are required (note, that this +For building Node.js on Linux, following packages are required (note, that this can vary from distribution to distribution): - * `git-core` + * `git` * `python` * `gcc-c++` or `g++` * `make` To bootstrap Node.js on Linux, run in terminal: - * OpenSUSE: `sudo zypper install git-core python gcc-c++ make` - * Fedora: `sudo dnf install git-core python gcc-c++ make` - * Ubuntu, Debian: `sudo apt-get install git-core python g++ make` + * OpenSUSE: `sudo zypper install git python gcc-c++ make` + * Fedora: `sudo dnf install git python gcc-c++ make` + * Ubuntu, Debian: `sudo apt-get install git python g++ make` + +## macOS + +To install required tools on macOS, run in terminal: +```console +xcode-select --install +``` [Boxstarter]: http://boxstarter.org/ [Boxstarter WebLauncher]: http://boxstarter.org/WebLauncher