Makefile: Wipe node_modules if not properly installed

If `make server` is already running (or port 9292 is someotherhow
already in use), and I run `make server` in a fresh clone, the test
server gets an EADDRINUSE and quits. However, it first starts up `make
test` in parallel, which does an `npm install`, which gets aborted
partway through. On my machine, this race condition results in the
packages seemingly all installed under `node_modules/*`, but not the
executables like `node_modules/.bin/lessc`.

The problem arises when subsequently building again (e.g. `PORT=9393
make server`), which runs `npm install` again, this time to completion.
`npm` sees all the packages and installed under `node_modules/*` and
doesn't try to complete the installation and install the
`node_modules/.bin/*` executables (it probably doesn't want to do a full
integrity check: ), instead
quitting and reports success, but the Makefile then fails when it tries
to do `node_modules/.bin/lessc`.
1 file changed
tree: ab6f6667996d85a48ff8243b0cd24776ef3319df
  1. .gitattributes
  2. .gitignore
  5. Makefile
  7. circle.yml
  8. docs/
  9. mkdocs.yml
  10. package.json
  11. quickstart.html
  12. script/
  13. src/
  14. test/


by Han, Jeanine, and Mary (

MathQuill is a web formula editor designed to make typing math easy and beautiful.

The MathQuill project is supported by its partners. We hold ourselves to a compassionate Code of Conduct.

MathQuill is resuming active development and we‘re committed to getting things running smoothly. Find a dusty corner? Let us know in Slack. (Prefer IRC? We’re #mathquill on Freenode.)

Getting Started

MathQuill has a simple interface. This brief example creates a MathQuill element and renders, then reads a given input:

var htmlElement = document.getElementById('some_id');
var config = {
  handlers: { edit: function(){ ... } },
  restrictMismatchedBrackets: true
var mathField = MQ.MathField(htmlElement, config);

mathField.latex('2^{\\frac{3}{2}}'); // Renders the given LaTeX in the MathQuill field
mathField.latex(); // => '2^{\\frac{3}{2}}'

Check out our Getting Started Guide for setup instructions and basic MathQuill usage.


Most documentation for MathQuill is located on ReadTheDocs.

Some older documentation still exists on the Wiki.

Open-Source License

The Source Code Form of MathQuill is subject to the terms of the Mozilla Public License, v. 2.0:

The quick-and-dirty is you can do whatever if modifications to MathQuill are in public GitHub forks. (Other ways to publicize modifications are also fine, as are private use modifications. See also: MPL 2.0 FAQ)