- Hands-On Machine Learning with JavaScript
- Burak Kanber
- 170字
- 2021-06-25 21:38:19
Installing Node.js
If you're a macOS user, the easiest way to install Node.js is through a package manager such as Homebrew or MacPorts. For best compatibility with the examples in this book, install Node.js version 9.4.0 or greater.
Windows users can also use the Chocolatey package manager to install Node.js, otherwise you may follow the instructions on the Node.js current download page: https://nodejs.org/en/.
Linux users should be careful if installing Node.js through their distribution's package manager, as the shipped version of Node.js may be a much older version. If your package manager uses a version older than V8, you may either add a repository to your package manager, build from source, or install from binary, as appropriate for your system.
Once you've installed Node.js, ensure that it runs and is the correct version by running node --version from the command line. The output will look like the following:
$ node --version
V9.4.0
This is also a good time to test that npm also works:
$ npm --version
5.6.0