Open pekam opened 10 months ago
Found a simple workaround: import the npm packages through a deps file.
deps.ts:
import cowsay from "cowsay";
export { cowsay };
notebook:
import { cowsay } from "./deps.ts";
It seems to work for me. How are you running it and what does your directory structure look like? Did you run npm install
or use some other package manager?
I do incorrectly get an error in the lsp though.
I'm running the notebook in VS Code, but as said, the same result happens in jupyter REPL (jupyter console --kernel deno
).
I followed exactly the steps in the blog post, and after that added a notebook file with the same code. So yes, I used npm install
.
Here's my entire project:
Anyway, it's not a big deal for me since I found a workaround, and if you can't reproduce it, I understand if you have higher priorities. :)
Stepst to reproduce:
cowsay
fromnode_modules
works with the BYONM flag.import cowsay from "cowsay";
).So it seems that the kernel does read the BYONM flag from
deno.json
and tries to take it into use, but fails to find the npm package innode_modules
?