-
Initial Machine Setup
First time running the starter kit? Then complete the Initial Machine Setup.
-
Run the app
npm start -s
This will run the automated build process, start up a webserver, and open the application in your default browser. When doing development with this kit, this command will continue watching all your files. Every time you hit save the code is rebuilt, linting runs, and tests run automatically. Note: The -s flag is optional. It enables silent mode which suppresses unnecessary messages during the build.
-
Having issues? See Having Issues?.
-
Install Node 4.0.0 or greater
(5.0 or greater is recommended for optimal build performance) Need to run multiple versions of Node? Use nvm.
-
Install Git.
-
Disable safe write in your editor to assure hot reloading works properly.
-
Complete the steps below for your operating system:
- Install watchman via
brew install watchman
or fswatch viabrew install fswatch
to avoid this issue which occurs if your macOS has no appropriate file watching service installed.
-
Run this to increase the limit on the number of files Linux will watch. Here's why.
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
.
-
Install Python 2.7. Some node modules may rely on node-gyp, which requires Python on Windows.
-
Install C++ Compiler. Browser-sync requires a C++ compiler on Windows.
Visual Studio Express comes bundled with a free C++ compiler.
If you already have Visual Studio installed: Open Visual Studio and go to File -> New -> Project -> Visual C++ -> Install Visual C++ Tools for Windows Desktop. The C++ compiler is used to compile browser-sync (and perhaps other Node modules).
- Install watchman via
-
Make sure you ran all steps in Get started including the initial machine setup.
-
Run
npm install
- If you forget to do this, you'll see this:babel-node: command not found
. -
Install the latest version of Node. Or install Node 5.12.0 if you're having issues on Windows. Node 6 has issues on some Windows machines.
-
Make sure files with names that begin with a dot (.editorconfig, .gitignore, .npmrc) are copied to the project directory root. This is easy to overlook if you copy this repository manually.
-
Don't run the project from a symbolic link. It may cause issues with file watches.
-
Delete any .eslintrc that you're storing in your user directory. Also, disable any ESLint plugin / custom rules that you've enabled within your editor. These will conflict with the ESLint rules defined in this project.
-
Make sure you don't have NODE_ENV set to production on your machine. If you do then the development dependencies won't be installed. Here's how to check.
-
Install watchman with
brew install watchman
if you are having the following error after an initialnpm start -s
:2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22) 2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22) events.js:160 throw er; // Unhandled 'error' event ^ Error: Error watching file for changes: EMFILE at exports._errnoException (util.js:1022:11) at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
-
Tip: Things to check if you get an
npm run lint
error or build error:-
If ESW found an error or warning in your project (e.g. console statement or a missing semi-colon), the lint thread will exit with
Exit status 1
. To fix:- Change the
npm run lint
script to"esw webpack.config.* src tools; exit 0"
- Change the
npm run lint:watch
script to"esw webpack.config.* src tools --watch; exit 0"
Note: Adding
exit 0
will allow the npm scripts to ignore the status 1 and allow ESW to print all warnings and errors. - Change the
-
Ensure the
eslint
/esw
globally installed version matches the version used in the project. This will ensure theesw
keyword is resolved.
-
-
Rebuild node-sass with
npm rebuild node-sass
if you are having and error likeNode Sass does not yet support your current environment on macOS XXX
after an initialnpm start -s
.
Check out the FAQ
If you have any questions regarding the contents of this repository, please email the Office of Systems Integration at FOSS@osi.ca.gov.