I have a npm module with a package.json at my folder ./module When I import that in a file and run it with deno, it throws an error 'error: Is a directory (os error 21)'. Likely this is because my module does not contain an index.js file. Instead it contains a package.json that has some entrypoints pointing to the correct javascript files:
{
"name": "my-module",
"main": "../../dist/lib/module/index.js",
"module": "../../dist/es/module/index.js",
"es2015": "../../dist/es/module/index.js",
"jsnext:main": "../../dist/es/module/index.js",
"types": "../../dist/types/module/index.d.ts",
"sideEffects": false
}
Running the same code with node.js works as should. I tried several import-maps configurations but they just give the same error.
Is is even possible to import local npm-modules with deno without having to import a specific .js file but the package.json folder?
Is is even possible to import local npm-modules with deno without having to import a specific .js file but the package.json folder?
As of Deno v1.37.1
, it is not currently possible. A path to the local module file must be specified — in either the import specifier or an import map entry.
This is being tracked on Github at the following issue: denoland/deno#18474