D
Deno

help

deno compile -A npm:cowsay not working

Ddsm239/13/2023
Hello, I am trying deno compile -A npm:cowsay and then following that with ./cowsay Hello World! but the result is:
error: Failed caching npm package 'cowsay@1.5.0'.

Caused by:
An npm specifier not found in cache: "cowsay", --cached-only is specified.
error: Failed caching npm package 'cowsay@1.5.0'.

Caused by:
An npm specifier not found in cache: "cowsay", --cached-only is specified.
Is there something I'm missing? I'm currently on macOS. Deno version 1.36.4
DAHDeno AI Helper9/13/2023
I'm sorry to hear that you're having trouble with deno compile. Based on the documentation, it seems like you might be missing a step. Before you can compile the npm package, you need to cache it first. You can do this by running deno cache --unstable npm:cowsay@1.5.0. This will download the package information and resolved versions of the package to Deno’s global npm cache. After you've cached the package, you should be able to compile it with deno compile -A npm:cowsay@1.5.0. Please give this a try and let me know if you're still encountering issues. 🦕
Ddsm239/13/2023
Same error
Llcasdev9/14/2023
cc @dsherret @dsm23 can you open an issue on the Deno repo? we will investigate further there
Ddsherret9/14/2023
@dsm23 strange. This works for me on both windows and linux without caching. Would you be able to open an issue? what does the directory look like that you're running this command in? (ex. do you have a package.json, deno.json with config, and what does the path look like)
Lleftdev9/14/2023
i don't remember 100%, but i had a similar experience not too long ago. I believe all npm: packages had to be installed via npm to be able to deno compile. is that expected behaviour? since i have a package.json i just ran npm i and it worked fine from then on. i don't think i even have npm: deps on that project anymore
Ddsherret9/14/2023
yeah, i just reproduced it thanks!
Lleftdev9/14/2023
i'm guessing that means it's not expected behaviour :p no prob
Ddsherret9/14/2023
yeah, it's not expected
Ddsherret9/14/2023
GitHub
deno compile fails if run in folder with package.json and uninstall...
cat package.json { "dependencies": { "node-fetch": "^3.3.2" } } > rm -rf node_modules > deno compile -A npm:cowsay > ./cowsay error: Failed caching npm p...

Looking for more? Join the community!

Recommended Posts
compiling issue with import { WebSocketServer } from "npm:ws@^8.14.1"Using this impot in a "deno run --unstable [etc...]" env works flawless / as intended but trying to Is there any way to get Deno to not statically analyze import()?I understand that statically analyzing and fetching dynamic import() calls is a good thing for perfoUsing Deno in Frontend.Hey, I was wandering if it is possible to use Deno for Vanilla Frontend development. I dont want to Excluding certain directories when using "walk"Hello, I'm writing a script that should crawl through a directory and search for a given text insideSyntax Error: Unexpected token 'export'Hello, We are using Supabase Deno Edge Functions and are getting this error while trying to import aDeno Deploy QuestionsHey there. We are using Supabase to run edge functions, which in turn built their feature on top of Bunle OAK static assets to the compiled binaryHi, I am currently switching from NodeJS to Deno, and so far so good! One of the reasons for this sThe requested module does not provide an export named 'default'I'm trying to export the following interface: ```import User from '../models/User.ts'; export defaI want to contribute to deno without disturbing my libs in linux . Is there a way?**Noob alert** I have been trying to contribute to deno . So i followed these instructions https://dTimezones in Dates?Hi everyone, what's the right way to create a `Date` with a specific timezone?Resolving Class constructor errorHello, I am currently trying to port a small test api from NodeJS to Deno. This code uses only NPM pKV list is returning an empty iterator, but data is there and gettable via getHello. To simplify things, I am setting a key of `["accounts", account.name]` but when I try to get Read permission & NPM importsHello, I'm using `--allow-read=.` to allow a script to read files in the current directory. The scriWebSocket connections killing setInterval()Hey Deno friends, it appears that websocket connections are somehow stopping the execution of setIntjsx in jsAll of my files containing JSX are in `.js` files. Is there an easy fix for this when running?http errorI need help because I have a service that has more than 1 million requests per day and for about 7 ddoes Deno vscode support nesting `deno.json`?There is a project I'm working on has nesting `deno.json` files. The parent `deno.json` is a bit outDeploy says Worker not defined for ESBuild (wasm.js)@Deno AI Helper I am having trouble understanding how to get the esbuilder to work on Deno Deploy, udeno_tui Label-classHello. I just started testing around with deno_tui and found the DrawObject-Class. How do i actuallyCannot read file "src/deno.json": not implemented on jsHey @Deno AI Helper ! I'm having a bit of trouble, I'm trying to use `deno.land/x/import` to use non