[ERR_MODULE_NOT_FOUND]
I get this error, and, surely, going into the aformentioned path to check, I don't seem to have the file it's looking for - even though the directory exists. (See the attached image)
Does anyone know how to fix this dependency issue? Do I need to run some sort of update/install/sync command for my environment? I thought you could just reference npm modules by prefixing the import paths with
npm:
7 Replies
My imports inside
server.ts
Does this have something to do with express and Deno looking for different versions of http or something?That looks like an actual bug inside Deno resolver. It should try to resolve
npm:http@1.0.0-security
. it should be something like npm:http@1.0.0/security
Probably something we can fix in a dayAwesome. Do you want me to provide you with any more information?
oh wait
it just writes the version prefix in reverse
is there a monkeypatch fix i can apply to the imports/urls to make it point to the right module version?
so i can test my app tonight
Soo, this is fun!
It appears you should use
from "node:http"
instead of from "npm:http"
- because the package on npm is https://www.npmjs.com/package/httpnpm
http
security holding package. Latest version: 0.0.1-security, last published: 5 years ago. Start using http in your project by running
npm i http
. There are 2206 other projects in the npm registry using http.Which is just a holder
I've no idea what goes on under the hood, but I will open an issue to provide a better message
But the change above will unblock you
GitHub
import { createServer } from "npm:http"
fails in a strange way · ...Version: Deno 2.0.0-rc.7 import { createServer } from "npm:http" $ deno run main.ts error: Could not resolve 'npm:http@0.0.1-security'. Caused by: [ERR_MODULE_NOT_FOUND] Cannot fi...