Deno compile not able to create files?
I want to create a simple CLI for a colleague at work that outputs a CSV file but I cannot seem to get Deno to create a file, even with the simplest of tests.
When I run this normally using
Deno run -A index.ts
it will work as intended but when compiled and run through the executable it will run successfully but no file is created.
Target OS: Windows
Dev OS: Mac M1 (arm)
CODE
Compile Command
6 Replies
Works fine for me. The text file is created in the folder where you ran the command. Maybe you looked somewhere else for it?
I am in the same folder as the compiled executable.. Are you also testing on Mac m1?
yeah, have the M2 here, but that shouldn't make any difference
I believe cross-compiled Deno apps have problems with relative paths
Try something like
Deno.cwd() + '/hello.txt'
@Lek
You might be right. I will give that try for my mac testing. I compiled to windows and copied that version over to my windows machine and it worked correctly. It must be something specific with the default cross compiled target on mac arm.
@marvinh. - Are you specifying a specific target with your compile for mac?
No, running the exact same commands as you listed here