elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

0.18 Cannot find module 'C:\WINDOWS\system32\repl-temp-000.js' #139

Closed hounded closed 7 years ago

hounded commented 7 years ago

Watched a couple of videos on elm, got all fired up, went to https://guide.elm-lang.org/ followed the install with the windows installer. Opened command line gave it a run and got the following error.

PS C:\WINDOWS\system32> elm-repl
---- elm-repl 0.18.0 -----------------------------------------------------------
 :help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> 1 / 2
module.js:327
    throw err;
    ^

Error: Cannot find module 'C:\WINDOWS\system32\repl-temp-000.js'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:974:3

>

Want to adopt but a bit frustrating when the very first command presents errors
Read the following https://groups.google.com/forum/#!topic/elm-discuss/KG-NkMT8Iv4 but was no help Scrolled through the issues but couldn't spot anything that stood out, any help appreciated.

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

hounded commented 7 years ago

don't use powershell

mitchellgreig commented 6 years ago

It's a small thing but this is the first result you get when getting this problem, and it doesn't actually help a person a figure out what's wrong.

It seems that elm-repl will create a project-like environment where it is run. If you open CMD from the start menu (which you are now likely to do since windows has removed it from the shift-right-click menu), it will default to the C:\WINDOWS\system32, and elm-repl does not have the permissions to create its directories/files there.

Both CMD and Powershell work fine (seemingly), if you cd to an empty directory. Minor issue, but it would have saved me some time to find this answer.