Stability: 1 - Experimental

    The current specifier resolution does not support all default behavior of the CommonJS loader. One of the behavior differences is automatic resolution of file extensions and the ability to import directories that have an index file.

    The --experimental-specifier-resolution=[mode] flag can be used to customize the extension resolution algorithm. The default mode is explicit, which requires the full path to a module be provided to the loader. To enable the automatic extension resolution and importing from directories that include an index file use the node mode.

    1. $ node index.mjs
    2. success!
    3. $ node index # Failure!
    4. Error: Cannot find module
    5. $ node --experimental-specifier-resolution=node index
    6. success!