The JavaScript bindings were importing @wasmer/wasi all the time, however our package.json only adds the package when one or more libraries/commands was compiled with WASI. That mean you can run into "Cannot find package @wasmer/wasi" errors.
$ node --loader ts-node/esm index.ts
(node:2902591) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
/tmp/tutorial-02/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:757
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base));
^
CustomError: Cannot find package '@wasmer/wasi' imported from /tmp/tutorial-02/node_modules/@wasmer/tutorial-02/src/bindings/index.js
at packageResolve (/tmp/tutorial-02/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:757:9)
at moduleResolve (/tmp/tutorial-02/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:798:18)
at Object.defaultResolve (/tmp/tutorial-02/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:912:11)
at /tmp/tutorial-02/node_modules/ts-node/src/esm.ts:218:35
at entrypointFallback (/tmp/tutorial-02/node_modules/ts-node/src/esm.ts:168:34)
at /tmp/tutorial-02/node_modules/ts-node/src/esm.ts:217:14
at addShortCircuitFlag (/tmp/tutorial-02/node_modules/ts-node/src/esm.ts:409:21)
at resolve (/tmp/tutorial-02/node_modules/ts-node/src/esm.ts:197:12)
at nextResolve (node:internal/modules/esm/loader:161:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:829:30)
The JavaScript bindings were importing
@wasmer/wasi
all the time, however ourpackage.json
only adds the package when one or more libraries/commands was compiled with WASI. That mean you can run into "Cannot find package@wasmer/wasi
" errors.