PureScript Installer

raw JSON →
0.3.5 verified Fri May 01 auth: no javascript maintenance

A command-line tool that installs the PureScript compiler to the current working directory. It first checks a disk cache, then downloads a prebuilt binary from the PureScript release page, and as a last resort compiles from source using Stack. Version 0.3.5 is the current stable release, with sparse updates since 2019. It is designed to be used behind the scenes by the `purescript` npm package, not directly by most users. Key differentiator: handles multiple installation strategies (cache, binary download, source compilation) automatically.

error Command failed: stack install
cause Stack (Haskell build tool) not installed or not in PATH, needed for source compilation fallback.
fix
Install Stack from https://docs.haskellstack.org/ or rely on prebuilt binaries (default).
error Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'
cause Attempting to install globally without appropriate permissions.
fix
Use npm install --save-dev purescript-installer locally instead of global install, or fix permissions.
error Error: Cannot find module 'purescript-installer'
cause Attempting to require('purescript-installer') as a library, but it's a CLI tool.
fix
Use npx install-purescript or define it in npm scripts; do not require it in code.
gotcha Version 0.3.1 and 0.3.2 were published without updating the version in package.json, causing potential version mismatch. Use v0.3.5 or later.
fix Update to v0.3.5: npm install purescript-installer@0.3.5
gotcha In version 0.2.1, the purs binary was accidentally included in the published tarball. This may cause confusion if users rely on the binary being present.
fix Use version 0.2.0 or upgrade to 0.3.x.
breaking The package is primarily designed for Node.js >= 12. Older Node versions may experience failures during installation or runtime.
fix Upgrade Node.js to version 12 or later.
deprecated The purescript-installer CLI is intended to be used indirectly through the purescript npm package. Direct use is discouraged for most users.
fix Use the `purescript` npm package which wraps this installer.
gotcha Binary name on Windows defaults to 'purs.exe', on others 'purs'. However, if package.json specifies a `bin` field for 'purs', that path is used. This can cause confusion if the bin field is set incorrectly.
fix Check your package.json `bin` field or use the --name flag to override the binary name.
npm install purescript-installer
yarn add purescript-installer
pnpm add purescript-installer

Install the purescript-installer package and run it to download a specific version of the PureScript compiler.

npm install --save-dev purescript-installer
npx install-purescript --purs-ver 0.14.5