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.js
but as_esy/default/pnp.js
(or_esy/NAME/pnp.js
for a named sandbox with nameNAME
). -
To execute pnp enabled
node
one usesesy node
invocation.
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-bin
package):% 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
install
andpostinstall
are being run).