-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Isaacs/docs lockfile #2475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Isaacs/docs lockfile #2475
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,17 +6,27 @@ description: Download and install node and npm | |
|
||
### Description | ||
|
||
To publish and install packages to and from the public npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. **We strongly recommend using a Node version manager to install Node.js and npm.** We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally. | ||
To publish and install packages to and from the public npm registry, you | ||
must install Node.js and the npm command line interface using either a Node | ||
version manager or a Node installer. **We strongly recommend using a Node | ||
version manager to install Node.js and npm.** We do not recommend using a | ||
Node installer, since the Node installation process installs npm in a | ||
directory with local permissions and can cause permissions errors when you | ||
run npm packages globally. | ||
|
||
### Overview | ||
|
||
- [Checking your version of npm and Node.js](#checking-your-version-of-npm-and-node-js) | ||
- [Using a Node version manager to install Node.js and npm](#using-a-node-version-manager-to-install-node-js-and-npm) | ||
- [Using a Node installer to install Node.js and npm](#using-a-node-installer-to-install-node-js-and-npm) | ||
- [Checking your version of npm and | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the hard wraps make it very awkward to review and presumably edit the text, and also makes git diffs much noisier; is there a reason it doesn’t soft wrap? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do hard wraps everywhere else in the docs. In vim, it definitely makes it easier to edit, and I would only be mildly opposed to moving to soft wraps (since I'd have to retrain some vim settings and muscle memory) but that's a separate conversation, and in the meantime, consistency is the way to go, imo. |
||
Node.js](#checking-your-version-of-npm-and-node-js) | ||
- [Using a Node version manager to install Node.js and | ||
npm](#using-a-node-version-manager-to-install-node-js-and-npm) | ||
- [Using a Node installer to install Node.js and | ||
npm](#using-a-node-installer-to-install-node-js-and-npm) | ||
|
||
### Checking your version of npm and Node.js | ||
|
||
To see if you already have Node.js and npm installed and check the installed version, run the following commands: | ||
To see if you already have Node.js and npm installed and check the | ||
installed version, run the following commands: | ||
|
||
``` | ||
node -v | ||
|
@@ -25,7 +35,10 @@ npm -v | |
|
||
### Using a Node version manager to install Node.js and npm | ||
|
||
Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on different versions. | ||
Node version managers allow you to install and switch between multiple | ||
versions of Node.js and npm on your system so you can test your | ||
applications on multiple versions of npm to ensure they work for users on | ||
different versions. | ||
|
||
#### OSX or Linux Node version managers | ||
|
||
|
@@ -39,28 +52,36 @@ Node version managers allow you to install and switch between multiple versions | |
|
||
### Using a Node installer to install Node.js and npm | ||
|
||
If you are unable to use a Node version manager, you can use a Node installer to install both Node.js and npm on your system. | ||
If you are unable to use a Node version manager, you can use a Node | ||
installer to install both Node.js and npm on your system. | ||
|
||
* [Node.js installer](https://nodejs.org/en/download/) | ||
* [NodeSource installer](https://github.com/nodesource/distributions). If you use Linux, we recommend that you use a NodeSource installer. | ||
* [NodeSource installer](https://github.com/nodesource/distributions). If | ||
you use Linux, we recommend that you use a NodeSource installer. | ||
|
||
#### OS X or Windows Node installers | ||
|
||
If you're using OS X or Windows, use one of the installers from the [Node.js download page](https://nodejs.org/en/download/). Be sure to install the version labeled **LTS**. Other versions have not yet been tested with npm. | ||
If you're using OS X or Windows, use one of the installers from the | ||
[Node.js download page](https://nodejs.org/en/download/). Be sure to | ||
install the version labeled **LTS**. Other versions have not yet been | ||
tested with npm. | ||
|
||
#### Linux or other operating systems Node installers | ||
|
||
If you're using Linux or another operating system, use one of the following installers: | ||
If you're using Linux or another operating system, use one of the following | ||
installers: | ||
|
||
- [NodeSource installer](https://github.com/nodesource/distributions) (recommended) | ||
- One of the installers on the [Node.js download page](https://nodejs.org/en/download/) | ||
|
||
Or see [this page](https://nodejs.org/en/download/package-manager/) to install npm for Linux in the way many Linux developers prefer. | ||
- [NodeSource installer](https://github.com/nodesource/distributions) | ||
(recommended) | ||
- One of the installers on the [Node.js download | ||
page](https://nodejs.org/en/download/) | ||
|
||
Or see [this page](https://nodejs.org/en/download/package-manager/) to | ||
install npm for Linux in the way many Linux developers prefer. | ||
|
||
#### Less-common operating systems | ||
|
||
For more information on installing Node.js on a variety of operating systems, see [this page][pkg-mgr]. | ||
|
||
For more information on installing Node.js on a variety of operating | ||
systems, see [this page][pkg-mgr]. | ||
|
||
[pkg-mgr]: https://nodejs.org/en/download/package-manager/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn’t this still relevant, since npm audit still unfortunately requires a lockfile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just felt somewhat out of place, especially in the "configuring-npm" section, since it's much more conceptual.
Maybe it should be brought back in (and updated for correctness) in the using-npm section?
Also, maybe Arborist.audit() should do
this.loadVirtual().catch(() => this.loadActual())
or.catch(() => this.buildIdealTree())
, so a lockfile isn't required? 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screw the docs, yes please do that :-D