Requiring modules like Node.js results in an access denied error message #9534
Replies: 3 comments 7 replies
-
|
You should read the Deno manual. Specifically: https://deno.land/[email protected]/examples/import_export Deno does no "magical" module resolution, unlike Node.js. So instead of importing a module with Most Node.js package aren't going to work when installed locally. Consider a CDN for sourcing these modules (like for example |
Beta Was this translation helpful? Give feedback.
-
|
That said, if you really want to require modules like node.js, you can just write your own require and use an async function require(path){
return await import(path)
} |
Beta Was this translation helpful? Give feedback.
-
|
Axios recently had a serious security issue, so it’s generally safer to avoid adding it unless you absolutely need it. Deno provides a built‑in, browser‑compatible fetch() API, you don’t need any external dependency for HTTP requests. Using fetch reduces your attack surface and avoids relying on packages that may introduce additional vulnerabilities. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Trying trivial snippet, which runs fine in node, but fails with deno:
typescript:
javascript generated with tsc version 4.1.5:
From Windows 10 Professional Power Shell launched as Adminsitrator:
With node:
With deno:
Beta Was this translation helpful? Give feedback.
All reactions