ChilliSniff
ChilliSniff2y ago

deno in Dockerfile

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 ?
5 Replies
ChilliSniff
ChilliSniffOP2y ago
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
ioB
ioB2y ago
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
ChilliSniff
ChilliSniffOP2y ago
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
ioB
ioB2y ago
👍
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View