deno compile -A npm:cowsay not working
Hello, I am trying
deno compile -A npm:cowsay
and then following that with ./cowsay Hello World!
but the result is:
Is there something I'm missing? I'm currently on macOS. Deno version 1.36.49 Replies
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. 🦕Same error
cc @dsherret
@dsm23 can you open an issue on the Deno repo? we will investigate further there
@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)
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 anymoreyeah, i just reproduced it
thanks!
i'm guessing that means it's not expected behaviour :p no prob
yeah, it's not expected
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...