Environment configuration Windows + NodeJS + MongoDB + Redis

1. The NodeJS version cannot be later than V9

Since the version of node installed locally may not be the same, it is best to install the NVM management Node version

NVM installation

Download address, download all the way after the installation can be

Tips: If you already have Node installed, you’d better uninstall it otherwise it will fail when switching versions

After the NVM is installed, add it to setting. TXT

Node_mirror: npm.taobao.org/mirrors/nod…

Npm_mirror: npm.taobao.org/mirrors/npm…

Common NVM directives are as follows:

  • NVM list: View the version currently installed/in use
  • NVM List available: Displays a partial list of downloadable versions
  • NVM install Version number: installs the specified version of nodeJS
  • NVM use Version number: uses the specified nodeJS version
  • NVM uninstall Version number: uninstalls the specified nodeJS version

Select 8.9.4 below V9 here

2.redis

You can unzip it to a directory such as D:/easymock/redis

Run the temporary service first and set the key values

  1. cmd D:/easymock/redis
  2. Run: redis.server.exe redis.windows.conf (start temporary service, service will be closed automatically when window is closed)
  3. Exe -h 127.0.0.1 -p 6379 set name’ name’ redis-cli.exe -h 127.0.0.1 -p 6379 set name’ name’
  4. Get name check ‘name’

Since EasyMock relies on Redis and MongoDB, it is best to set it to service startup

Redis custom Windows service installation

  1. cmd D:/easymock/redis
  2. Exe –service-install redis.windows.conf –service-name redisserver1 –loglevel verbose

The console type services. MSC to view the redisserver1 you just created, change the startup type to Automatic, and apply

Instructions that may be used later

  • Exe –service-install redis.windows.conf –service-name redisserver1 –loglevel verbose
  • Exe –service-start –service-name redisserver1 to start the service
  • Exe –service-stop –service-name redisserver1 to stop the service
  • Uninstall service: redisserver. exe –service-uninstall–service-name redisserver1

3.MongoDB

Download the address, then install, install the time to select the installation folder

  1. Go to the installation directory and create a new folder db under \data
  2. cmd .. \bin: mongod –dbpath D: easyMock \MongoDB\Server\4.4\data\db (the path depends on personal installation)
  3. Type in your browser:http://localhost:27017/It looks like you are trying to access MongoDB over HTTP on the native driver port. Redis is successfully configured.

Mongo custom Windows service installation

Create the mongo.conf file at the bin level

Dbpath = D: easyMock \MongoDB\Server\4.4\data\db logpath = D: easyMock \MongoDB\Server\4.4\log\ MongoDB

  1. cmd … \bin Enter: mongod –config D: easyMock \MongoDB\Server\4.4\mongo.conf — install-servicename “MongoDB”
  2. Enter services. MSC to see that the service is successfully installed. You can set the startup mode to automatic, similar to Redis

4.easy-mock

$git clone github.com/easy-mock/e…

$ cd easy-mock && npm install

  • Modify the changeseasy-mock\configLocalhost :’0.0.0.0′
  • The NPM run dev command is successfully started