docs: add steps to install npm and lessc

[CI SKIP]
pull/5927/head
ᴜɴᴋɴᴡᴏɴ 2020-02-19 16:53:10 +08:00
parent 8d73608672
commit 7b5b070900
No known key found for this signature in database
GPG Key ID: B43718D76E30A238
1 changed files with 16 additions and 7 deletions

View File

@ -24,6 +24,7 @@ Gogs has the following dependencies:
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) (v1.8.3 or higher) - [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) (v1.8.3 or higher)
- [Go](https://golang.org/doc/install) (v1.11 or higher) - [Go](https://golang.org/doc/install) (v1.11 or higher)
- [Less.js](http://lesscss.org/usage/#command-line-usage-installing)
- [GNU Make](https://www.gnu.org/software/make/) - [GNU Make](https://www.gnu.org/software/make/)
- Database upon your choice (pick one, we choose PostgreSQL in this document): - Database upon your choice (pick one, we choose PostgreSQL in this document):
- [PostgreSQL](https://wiki.postgresql.org/wiki/Detailed_installation_guides) (v9.6 or higher) - [PostgreSQL](https://wiki.postgresql.org/wiki/Detailed_installation_guides) (v9.6 or higher)
@ -35,19 +36,20 @@ Gogs has the following dependencies:
### macOS ### macOS
1. Install [Homebrew](https://brew.sh/). 1. Install [Homebrew](https://brew.sh/).
2. Install dependencies: 1. Install dependencies:
```bash ```bash
brew install go postgresql git go-bindata brew install go postgresql git go-bindata npm
npm install -g less
``` ```
3. Configure PostgreSQL to start automatically: 1. Configure PostgreSQL to start automatically:
```bash ```bash
brew services start postgresql brew services start postgresql
``` ```
4. Ensure `psql`, the PostgreSQL command line client, is on your `$PATH`. 1. Ensure `psql`, the PostgreSQL command line client, is on your `$PATH`.
Homebrew does not put it there by default. Homebrew gives you the command to run to insert `psql` in your path in the "Caveats" section of `brew info postgresql`. Alternatively, you can use the command below. It might need to be adjusted depending on your Homebrew prefix (`/usr/local` below) and shell (bash below). Homebrew does not put it there by default. Homebrew gives you the command to run to insert `psql` in your path in the "Caveats" section of `brew info postgresql`. Alternatively, you can use the command below. It might need to be adjusted depending on your Homebrew prefix (`/usr/local` below) and shell (bash below).
```bash ```bash
@ -57,20 +59,27 @@ Gogs has the following dependencies:
### Ubuntu ### Ubuntu
1. Add package repositories:
```bash
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
```
1. Update repositories: 1. Update repositories:
```bash ```bash
sudo apt-get update sudo apt-get update
``` ```
2. Install dependencies: 1. Install dependencies:
```bash ```bash
sudo apt install -y make git-all postgresql postgresql-contrib golang-go sudo apt install -y make git-all postgresql postgresql-contrib golang-go nodejs
go get -u github.com/kevinburke/go-bindata/... go get -u github.com/kevinburke/go-bindata/...
npm install -g less
``` ```
3. Configure startup services: 1. Configure startup services:
```bash ```bash
sudo systemctl enable postgresql sudo systemctl enable postgresql