Skip to content

Commit 2ac67e9

Browse files
authored
feat: fix node version to 12 in server/client (#386)
* feat: fix node version to 12 in server/client * file: update readme
1 parent 81fc9b1 commit 2ac67e9

7 files changed

Lines changed: 22 additions & 8 deletions

File tree

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,22 @@ Please add any missing content to this readme.
1717
## Development Setup
1818

1919
### Install git
20+
2021
See https://git-scm.com/downloads for instructions.
2122

2223
### Install Node.js
23-
_Node.js version 8.x works best for now; later versions have exhibited some strange behaviour with this project.
24+
25+
_Node.js version 12.x works best for now; later versions have exhibited some strange behaviour with this project.
2426
If you encounter issues with the server, check your version of Node.js first._
2527

2628
We recommend using [nvm](https://github.com/nvm-sh/nvm) to install and manage your Node.js instances.
2729

28-
Alternatively, you can install Node.js directly from https://nodejs.org/dist/latest-v8.x/
30+
Alternatively, you can install Node.js directly from https://nodejs.org/dist/latest-v12.x/
2931

3032
_On MacOS, you can alleviate the need to run as sudo by using nvm or by [following John Papa's instructions](http://jpapa.me/nomoresudo)._
3133

3234
### Clone this project
35+
3336
1. Open terminal
3437
1. Go to a folder where you would like to install the project. Then type the following:
3538

@@ -38,13 +41,15 @@ git clone https://github.com/Greenstand/treetracker-admin.git
3841
```
3942

4043
### Project Setup
44+
4145
Once cloned, type:
4246

4347
```
4448
cd treetracker-admin/server && touch .env src/datasources/treetracker.datasource.json
4549
```
4650

4751
This sets up the following:
52+
4853
- A `treetracker.datasource.json` file in `server/src/datasources/` that will be used to reference the source of data for Loopback.
4954
- A `.env` file in `server` that will contain a JWT secrect.
5055

@@ -76,7 +81,7 @@ Once Docker is installed, lauch Docker from the Applications GUI.
7681

7782
For most versions of Windows: [Docker for Windows](https://docs.docker.com/docker-for-windows/install/)
7883

79-
For some older versions or Win10 Home: [Docker Toolbox](https://docs.docker.com/toolbox/toolbox_install_windows/).
84+
For some older versions or Win10 Home: [Docker Toolbox](https://docs.docker.com/toolbox/toolbox_install_windows/).
8085
At least on one machine, to get this to work, when you get to the step to do QuickStart terminal script, instead, run:
8186

8287
```
@@ -91,7 +96,7 @@ then re-run the QuickStart terminal script.
9196
#### Linux
9297

9398
To install on linux, you can run
94-
```sudo apt-get install -y docker-ce```
99+
`sudo apt-get install -y docker-ce`
95100
but there is [additional setup](https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository) to verify keys, etc.
96101

97102
### Install, build docker containers and go
@@ -171,6 +176,7 @@ REACT_APP_API_ROOT=http://localhost:3000
171176
So the React App would connect to http://localhost:3000 for API server.
172177

173178
#### Start server
179+
174180
```
175181
cd server
176182
NODE_ENV=development ./node_modules/.bin/nodemon
@@ -181,12 +187,14 @@ NODE_ENV=development ./node_modules/.bin/nodemon
181187
> Using `nodemon` to run the server rather than `npm start` automatically refreshes the server when files change.
182188
183189
#### Start client
190+
184191
```
185192
cd client
186193
npm start
187194
```
188195

189196
#### View the Treetracker Admin Panel
197+
190198
Visit http://localhost:3001
191199

192200
## Quick Start For API only development
@@ -395,4 +403,3 @@ npm run watch
395403
In this way, we can write the code and get the tests result immediately.
396404

397405
NOTE when run tests, the files related to Loopback are loading from ./dist folder, that's because for Jest, it do not output compiled files totally.
398-

client/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

client/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12

client/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,8 @@
7474
"eslint-plugin-react": "^7.19.0",
7575
"prettier": "2.0.5",
7676
"react-inspector": "^3.0.2"
77+
},
78+
"engines": {
79+
"node": ">= 12 < 13"
7780
}
7881
}

server/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
package-lock=true
2+
engine-strict=true

server/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12

server/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
"loopback"
88
],
99
"main": "dist/index.js",
10-
"engines": {
11-
"node": ">=8.9"
12-
},
1310
"scripts": {
1411
"build": "lb-tsc --allowJs -d false",
1512
"build:watch": "lb-tsc --watch",
@@ -92,5 +89,8 @@
9289
],
9390
"ext": "ts,js",
9491
"exec": "npm start"
92+
},
93+
"engines": {
94+
"node": ">= 12 < 13"
9595
}
9696
}

0 commit comments

Comments
 (0)