elm / compiler

Compiler for Elm, a functional language for reliable webapps.
https://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
7.52k stars 661 forks source link

Elm make error when trying to create a directory due to permissions #2042

Open rl-king opened 4 years ago

rl-king commented 4 years ago

Elm make returns an error if it does not have permission to create a directory.

Ran into this when I didn't to provide a relative path to --output.

SSCCE

elm make src/Main.elm --output=/public/main.js
-- ERROR -----------------------------------------------------------------------

I ran into something that bypassed the normal error reporting process! I
extracted whatever information I could from the internal error:

>   /public: createDirectory: permission denied (Permission denied)
wingyplus commented 4 years ago

What do you expect to see? I think it's correct error due to you're create a file that you have not permission.

rl-king commented 4 years ago

This is the complete error message:

elm make src/Main.elm --output=/public/main.js
Success!     

-- ERROR -----------------------------------------------------------------------

I ran into something that bypassed the normal error reporting process! I
extracted whatever information I could from the internal error:

>   /public: createDirectory: permission denied (Permission denied)

These errors are usually pretty confusing, so start by asking around on one of
forums listed at https://elm-lang.org/community to see if anyone can get you
unstuck quickly.

-- REQUEST ---------------------------------------------------------------------

If you are feeling up to it, please try to get your code down to the smallest
version that still triggers this message. Ideally in a single Main.elm and
elm.json file.

From there open a NEW issue at https://github.com/elm/compiler/issues with your
reduced example pasted in directly. (Not a link to a repo or gist!) Do not worry
about if someone else saw something similar. More examples is better!

This kind of error is usually tied up in larger architectural choices that are
hard to change, so even when we have a couple good examples, it can take some
time to resolve in a solid way.elm: /public: createDirectory: permission denied (Permission denied)