Compare commits

..

7 Commits

Author SHA1 Message Date
Jordan Harband
aa71b65b94 fixup 2019-10-29 12:52:05 -07:00
Jordan Harband
25365b3225 [readme] add OpenJSF logo 2019-10-29 12:33:13 -07:00
Jordan Harband
c0fe20f544 [meta] add OpenJSF CoC reference 2019-10-29 12:34:18 -07:00
Jordan Harband
7d67b26f76 [meta] add CODE_OF_CONDUCT.md 2019-10-29 11:46:36 -07:00
Marit Iren
1eca354233 [Docs] Add description if instructions don't work; make install instructions more readable 2019-10-20 17:08:29 +02:00
Guido Bouman
0a4e6f2b70 [meta] Update ISSUE_TEMPLATE.md
Remove the need to indent terminal output by using headings instead of a list.
Simplify formulation of steps
2019-10-08 15:27:53 +02:00
Jordan Harband
94a72ae217 [Fix] nvm use: improve help output with bare nvm use and no .nvmrc
Closes #1914.
2019-10-08 14:40:17 -07:00
4 changed files with 128 additions and 46 deletions

View File

@@ -1,42 +1,44 @@
<!-- Thank you for being interested in nvm! Please help us by filling out the following form if youre having trouble. If you have a feature request, or some other question, please feel free to clear out the form. Thanks! -->
- Operating system and version:
#### Operating system and version:
- `nvm debug` output:
<details>
<!-- do not delete the following blank line -->
#### `nvm debug` output:
<details>
<!-- do not delete the following blank line -->
```sh
```sh
```
</details>
```
</details>
- `nvm ls` output:
<details>
<!-- do not delete the following blank line -->
#### `nvm ls` output:
<details>
<!-- do not delete the following blank line -->
```sh
```sh
```
</details>
```
</details>
- How did you install `nvm`? (e.g. install script in readme, Homebrew):
#### How did you install `nvm`?
<!-- (e.g. install script in readme, Homebrew) -->
- What steps did you perform?
#### What steps did you perform?
- What happened?
#### What happened?
- What did you expect to happen?
#### What did you expect to happen?
- Is there anything in any of your profile files (`.bashrc`, `.bash_profile`, `.zshrc`, etc) that modifies the `PATH`?
#### Is there anything in any of your profile files that modifies the `PATH`?
<!-- (e.g. `.bashrc`, `.bash_profile`, `.zshrc`, etc) -->
<!-- if this does not apply, please delete this section -->
- If you are having installation issues, or getting "N/A", what does `curl -I --compressed -v https://nodejs.org/dist/` print out?
<details>
<!-- do not delete the following blank line -->
<!-- Please remove the following section if it does not apply to you -->
#### If you are having installation issues, or getting "N/A", what does `curl -I --compressed -v https://nodejs.org/dist/` print out?
<details>
<!-- do not delete the following blank line -->
```sh
```sh
```
</details>
```
</details>

81
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,81 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at ljharb@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
## OpenJS Foundation
As a member of the OpenJS Foundation, this project also follows the Foundations overarching
[Code of Conduct](https://github.com/openjs-foundation/cross-project-council/blob/master/CODE_OF_CONDUCT.md).

View File

@@ -1,5 +1,9 @@
# Node Version Manager [![Build Status](https://travis-ci.org/nvm-sh/nvm.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.35.0-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684)
<br />
`nvm` is an <img alt="OpenJS Foundation" src="https://raw.githubusercontent.com/openjs-foundation/cross-project-council/master/logos/openjsf-color.png" width="150" align="left" /> project, and we follow our <a href="https://github.com/nvm-sh/nvm/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a>.
<br /><br />
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents
@@ -44,27 +48,24 @@
### Install & Update script
To **install** or **update** nvm, you can use the [install script][2] using cURL:
To **install** or **update** nvm, you should run the [install script][2]. To do that, you may either download and run the script manually, or use the following cURL or Wget command:
```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
```
or Wget:
```sh
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
```
<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).</sub>
<sub>**Note:** If the environment variable `$XDG_CONFIG_HOME` is present, it will place the `nvm` files there.</sub>
Running either of the above commands downloads a script and runs it. The script clones the nvm repository to `~/.nvm`, and adds the source lines from the snippet below to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).
<a id="profile_snippet"></a>
```sh
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
```
<sub>**Note:** If the environment variable `$XDG_CONFIG_HOME` is present, it will place the `nvm` files there.</sub>
**Note:** You can add `--no-use` to the end of the above script (...`nvm.sh --no-use`) to postpone using `nvm` until you manually [`use`](#usage) it.
You can customize the install source, directory, profile, and version using the `NVM_SOURCE`, `NVM_DIR`, `PROFILE`, and `NODE_VERSION` variables.
@@ -72,24 +73,18 @@ Eg: `curl ... | NVM_DIR="path/to/nvm"`. Ensure that the `NVM_DIR` does not conta
<sub>*NB. The installer can use `git`, `curl`, or `wget` to download `nvm`, whatever is available.*</sub>
**Note:** On Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type:
```sh
command -v nvm
```
simply close your current terminal, open a new terminal, and try verifying again.
**Note:** On Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type `command -v nvm`, simply close your current terminal, open a new terminal, and try verifying again.
**Note:** Since OS X 10.9, `/usr/bin/git` has been preset by Xcode command line tools, which means we can't properly detect if Git is installed or not. You need to manually install the Xcode command line tools before running the install script, otherwise, it'll fail. (see [#1782](https://github.com/nvm-sh/nvm/issues/1782))
**Note:** On OS X, if you get `nvm: command not found` after running the install script, one of the following might be the reason:-
**Note:** On OS X, if you get `nvm: command not found` after running the install script, one of the following might be the reason:
- your system may not have a `.bash_profile` file where the command is set up. Create one with `touch ~/.bash_profile` and run the install script again
- you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.
- Your system may not have a `.bash_profile` file where the command is set up. Create one with `touch ~/.bash_profile` and run the install script again
- You might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.
If the above doesn't fix the problem, open your `.bash_profile` and add the following line of code:
`source ~/.bashrc`
If the above doesn't fix the problem, you may try the following:
- Open your `.bash_profile` (or `~/.zshrc`, `~/.profile`, or `~/.bashrc`) and add the following line of code: `source ~/<your_profile_file>`. E.g. `source ~/.bashrc` or `source ~/.zshrc`.
- If the above don't work, try adding the [snippet from the install section](#profile_snippet) that finds the correct nvm directory and loads nvm, to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).
- For more information about this issue and possible workarounds, please [refer here](https://github.com/nvm-sh/nvm/issues/576)

4
nvm.sh
View File

@@ -2909,6 +2909,10 @@ nvm() {
VERSION="$(nvm_version "${PROVIDED_VERSION}")"
fi
unset NVM_RC_VERSION
if [ -z "${VERSION}" ]; then
nvm_err 'Please see `nvm --help` or https://github.com/nvm-sh/nvm#nvmrc for more information.'
return 127
fi
else
VERSION="$(nvm_match_version "${PROVIDED_VERSION}")"
fi