Node/npm Compatibility
esy can install packages from npm registry.
This means esy install can also install packages which contain JavaScript
code.
Accessing installed JS packages
As opposed to a standard way of installing packages into project's
node_modules directory esy uses plug'n'play installation mechanism
(pnp for short) pioneered by yarn.
There are few differences though:
-
esy puts pnp runtime not as
.pnp.jsbut as_esy/default/pnp.js(or_esy/NAME/pnp.jsfor a named sandbox with nameNAME). -
To execute pnp enabled
nodeone usesesy nodeinvocation.
All binaries installed with npm packages are accessible via esy COMMAND
invocation, few example:
-
To run webpack (comes from
webpack-cli):% esy webpack -
To run
flow(comes fromflow-binpackage):% esy flow
Caveats
-
Not all npm packages currently support being installed with plug'n'play installation mechanism.
-
Not all npm lifecycle hooks are supported right now (only
installandpostinstallare being run).