OCaml

raw JSON →
5.3.0 verified Fri May 01 auth: no javascript

OCaml compiler packaged for esy. This package provides the OCaml compiler and standard library for use with esy, a package manager for native development. Version 5.3.0 is the current stable release. It is not intended for direct npm consumption but as a dependency for esy-based projects. Key differentiator: it enables OCaml development within the npm/JavaScript ecosystem via esy.

error Error: Cannot find module 'ocaml'
cause Attempting to require or import the package directly in JavaScript.
fix
This package is not a JavaScript module; use esy to invoke the OCaml compiler.
gotcha This package is designed for esy, not direct npm consumption. Use esy to manage OCaml dependencies.
fix Use esy init and add ocaml to your esy dependencies.
gotcha No README data found; rely on OCaml's official documentation for usage.
fix Refer to ocaml.org/docs.
npm install ocaml
yarn add ocaml
pnpm add ocaml

Minimal esy project configuration to use OCaml 5.3.0.

{
  "name": "my-ocaml-project",
  "version": "1.0.0",
  "esy": {
    "build": "dune build"
  },
  "dependencies": {
    "@opam/dune": "*",
    "ocaml": "~5.3.0"
  }
}