Upgrade you node.js and npm to latest version by following steps
- install nvm(node version manager):
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bashAfter install, open a new terminal.
- install latest version of node.js:
nvm install 8.11.1- Check result:
node --version
8.11.1
npm --version
5.6.0- install client-side dependencies
npm run client-install- run client-side application
npm run client- run server-side application
npm run server- run both client-side and server-side (mostly use)
npm run devClient-side application is developed using ReactJs + Apollo.
All code for client-side is in "./client" and monitored and auto-regenerated by webpack.
Server-side application is developed using NodeJS + GraphQL + Express + MongoDB.
All code for Server-side is in "./server" and monitored and auto-restarted by nodemon.
Using "esm" allows writing es6 syntax in nodejs code.
Such as using "import" to replace "require()".
And please use es6 syntax at any place it can.
More detail about esm please checkout this:
https://github.com/standard-things/esm
https://www.youtube.com/watch?v=60S1PFndbn0