I recently started exploring deno. I wanted to run a script and write data into a file and save it in a folder. In that case I used fs-extra. Even if I install the package, i am getting the error “Cannot find module ‘npm:fs-extra’ or its corresponding type declarations“
Installation command I used:
deno install npm:fs-extra
deno.json file:
"tasks": {
"dev": "deno run --watch main.ts"
},
"imports": {
"@std/assert": "jsr:@std/assert@1",
"fs-extra": "npm:fs-extra@^11.2.0",
"mongodb": "npm:mongodb@^6.10.0"
}
}
I imported it to the main.ts like this:
import fs from 'npm:fs-extra';
I tried using this way as well:
import fs from 'fs-extra';
But neither way worked out