D
Deno

help

deno in Dockerfile

CChilliSniff2/28/2023
i have successfully installed deno with theese commands:
# install denojs
RUN curl -fsSL https://deno.land/x/install/install.sh | sh
ENV DENO_INSTALL /root/.deno
ENV PATH="$DENO_INSTALL/bin:$PATH"
# install denojs
RUN curl -fsSL https://deno.land/x/install/install.sh | sh
ENV DENO_INSTALL /root/.deno
ENV PATH="$DENO_INSTALL/bin:$PATH"
in my Dockerfile, but when i try to run a script:
// export { Buffer } from "https://deno.land/std/node/buffer.ts";
import { Buffer } from "https://deno.land/std/node/buffer.ts";
console.log(Buffer)
// export { Buffer } from "https://deno.land/std/node/buffer.ts";
import { Buffer } from "https://deno.land/std/node/buffer.ts";
console.log(Buffer)
inside the virtual docker container i get the following message
Warning Implicitly using latest version (0.178.0) for https://deno.land/std/node/buffer.ts
error: Module not found "https://deno.land/std/node/buffer.ts".
Warning Implicitly using latest version (0.178.0) for https://deno.land/std/node/buffer.ts
error: Module not found "https://deno.land/std/node/buffer.ts".
what could be going on ? i think the module is just down, it worked on my local machine because it was still in the cache , when i run the test with :
deno cache --reload tmp.js
deno cache --reload tmp.js
i also get the error on my physical machine visiting https://deno.land/std@0.178.0/node/buffer.ts shows a 404 Not Found message, i am going to report this
IioB2/28/2023
This script is not correct for several reasons. First of all, you should be using node specifiers:
import { Buffer } from "node:buffer"
import { Buffer } from "node:buffer"
if it was any other module, you should pin the version of the module. std/node was removed in deno 1.31.0
CChilliSniff3/1/2023
actually i had a unused import in my script, the module which depends on buffer.ts is this https://deno.land/x/mysql2 , exactly here : https://deno.land/x/mysql2@v1.0.6/deps.ts?source luckily i do not need this module, i just forgot to remove the import
IioB3/1/2023
👍
UUUnknown User3/4/2023
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

Recommended Posts
could not find npm package forI'm trying to make Hardhat CLI work with Deno but I stumbled upon this error which comes from Deno: Microsoft Transact SQLIs there official Deno driver for this or a recommended way?Remove std/node, it was merged into Deno itself (#3206)This used to work, but now it doesn't. Where do you show examples of where this was moved to and howFFI Difference between buffer and pointerI’ve been using interchangeably `Deno.UnsafePointer.of(new Uint8Array())` with type `pointer` and `nDetecting invalid JS stringsIs there any built-in way to "detect" invalid strings? Here's an example: ```ts // this is an invaError connecting to MongoDB AtlasHello, I'm trying to connect to MongoDB Atlas via `mongoose` (`npm:mongoose`) but encountered the fointeract with deno Extension at runtimeIs there any way to interact with an extension at code execution? I need to pass a pointer from my rAny good way to modify remote url file and debug it?For example, I'm using `import server "https://deno.land/x/ultra@v2.1.7/server.ts"` I want to modifyCache related headers not included in deno deploy for static file servingI have a hello world level static site using `serveDir`. When I run the site locally I see that WeakError with relativ import path after "deno install"Is it possible that imports in deno.json are ignored after "deno install"? ```bash deno run ./my-Run examples on WindowsAnyone know how to run the `Piping to files` example on Windows? https://deno.land/manual@v1.30.3/exPython alternative to ctypes, can't figure how to convert a codeHello, I am trying to convert a Python ctypes code to Deno using FFI, but can't know why its not woSuggestions for minimal JSX rendering?Any suggestions for rendering jsx to a string (or ideally a stream), in the most minimal manner fromDeno.run Strange IssueI use `Deno.run` + stdout/signals/etc a lot, but this behavior is beyond my current debugging abilitProperly continuously read data from a ReaderWhat's the proper way to continuously read from a `Deno.Reader`? I'm trying to parse incoming HTTP2npm:redis – everything returns `string`?Every command I try to use from `npm:redis` seems to have inferred return type `string`. Look at theMy magic middlewares typeIf anyone wants a typescript challange here is one: I am trying to create a tuple type which containRead one byte at a time from ReadableStreamWhat would be the most obvious way to read a single byte from a ReadableStream at a time?