Skip to content
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

Update install guidelines #269

Merged
merged 1 commit into from
Aug 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions tech/languages/nodejs/nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,45 @@ subsection: nodejs
section: tech-languages
order: 1
version: LTS
Copy link
Contributor

@pvalena pvalena Jun 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version variable is no longer used anywhere, could you remove it?

description: Open-source cross-platform server-side JavaScript runtime environment.
---

# Node.js

## Node.js and npm
## Node.js and npm installation

Starting from Fedora 24, npm is a part of Node.js package and does not need to be installed separately. Therefore, to install both npm and Node.js, you need to run:

```
$ sudo dnf install nodejs
```

In case you are running Fedora 23, you should run:
This will install V8 Javascript Engine, Node.js runtime and npm package manager and their dependencies. Versions present in repositories are usually current or to-be (in Rawhide) Node.js LTS releases, including npm and V8 engine that come with them.

You can check the available versions with:

```
$ sudo dnf install npm
$ dnf info nodejs
$ dnf info nodejs --enablerepo rawhide
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rawhide repository is not included in basic Fedora install AFAIK, so this wouldn't work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will soon work with just --releasever=30 instead of --enablerepo rawhide, right?

```

This will install V8 Javascript Engine, Node.js runtime and npm package manager and their dependencies. Versions present in repositories are usually current or to-be (in Rawhide) Node.js LTS releases, including npm and V8 engine that come with them.
## Yarn

If you wish to install Node.js v4:
[Yarn](https://yarnpkg.com/en/) package manager is available since Fedora 29. You can install it by running:

```
$ sudo dnf install nodejs --releasever=24
$ sudo dnf install nodejs-yarn
```

If you need Node.js v6:
Because of conflicts with other packages, yarn has to be used in the following manner:

```
$ sudo dnf install nodejs --releasever=25
$ nodejs-yarn add request
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a comment describing what is done, like so:

# Install package request using nodejs-yarn
[ . . ]
# Install package request using yarnpkg

$ yarnpkg add request
```

If you still wish to use `yarn` instead of `nodejs-yarn`, the best way is to use bash alias.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include the alias example, please?


## Installing npm modules

Installing Node.js modules is covered in [Node.js modules](/tech/languages/nodejs/modules.html).