Recommended tooling for PureScript applications in 2019

Some notes about npx:

  1. yarn spago (or yarn run spago) will run the locally installed spago, no need to use npx for this (see https://yarnpkg.com/lang/en/docs/cli/run/#toc-yarn-run-script).

  2. npx has a resolution order for running stuff. It will first check $PATH, then local packages, then if a command wasn’t found locally in either of those places, it will try to install the relevant package from the package repository (see https://github.com/npm/npx/blob/latest/README.md#description). It will not update the package.json of the project to indicate the packages that were installed. This has led my company to some hard to understand issues where things would work on one developer’s machines but not others, and makes it generally hard to reproduce system state.

Due to these points, I strongly recommend moving away from npx (my project at work has done so and the behavior of yarn run effectively supersedes npx). Note that the yarn run behavior mentioned here does not apply to npm, if you’re on npm you may still benefit from npx.

1 Like