问题描述
我是 Elm 的新手。而且我英语不好。所以,如果有任何歧义或错误的地方,请让我更正。
----------- 编辑 -----------
我下面的所有问题都在 WSL 上。当我在 Windows 上尝试时,一切正常。那么……为什么 elm install
在 WSL 上不起作用?你有什么想法吗?
-------- 问题 --------
当我尝试 elm-test init
时,它不像下面那样工作
$ elm-test init
Here is my plan:
Add:
elm/random 1.0.0
elm-explorations/test 1.2.2
Would you like me to update your elm.json accordingly? [Y/n]:
-- PROBLEM DOWNLOADING PACKAGE -------------------------------------------------
I was trying to download the source code for elm/random 1.0.0,so I tried to
fetch:
https://github.com/elm/random/zipball/1.0.0/
But my HTTP library is giving me the following error message:
ConnectionTimeout
Are you somewhere with a slow internet connection? Or no internet? Does the link
I am trying to fetch work in your browser? Maybe the site is down? Does your
internet connection have a firewall that blocks certain domains? It is usually
something like that!
但我的浏览器(Chrome)运行良好,甚至在 WSL(我运行 elm-test init
命令的环境)中也是如此。
$ curl https://github.com/elm/random/zipball/1.0.0/
https://codeload.github.com/elm/random/legacy.zip/1.0.0<body>You are being <a href="https://codeload.github.com/elm/random/legacy.zip/1.0.0">redirected</a>.</body></html>
然后我也再次尝试重定向 URL
$ curl https://codeload.github.com/elm/random/legacy.zip
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway,or consider "--output
Warning: <FILE>" to save to a file.
我认为没有网络问题。我的电脑可以连接repo,我觉得下载会很好。
我最后只尝试了 elm install
,这也引发了同样的错误。 Elm 似乎无法连接到 repo,即使我的电脑可以。
$ elm install elm/random
Here is my plan:
Add:
elm/random 1.0.0
Would you like me to update your elm.json accordingly? [Y/n]:
-- PROBLEM DOWNLOADING PACKAGE -------------------------------------------------
I was trying to download the source code for elm/random 1.0.0,so I tried to
fetch:
https://github.com/elm/random/zipball/1.0.0/
But my HTTP library is giving me the following error message:
ConnectionTimeout
Are you somewhere with a slow internet connection? Or no internet? Does the link
I am trying to fetch work in your browser? Maybe the site is down? Does your
internet connection have a firewall that blocks certain domains? It is usually
something like that!
请帮帮我,我该怎么办?
解决方法
我最近有理由使用 WSL 进行 elm 开发。这不是很有趣,我很高兴回到 Mac 上!我发现 WSL 上的某些磁盘操作似乎进行得很慢,这可能会导致各种奇怪的问题。
我使用的是 Webstorm,它不能很好地处理 WSL,所以最后我在 C: 驱动器上(而不是在 /home/...
中)做了所有事情,以便 webstorm 可以运行 windows 版本的 elm-format,而我的node开发环境运行在linux层。
这不是您问题的准确答案,只是说可以做到,但根据我的经验,这不是编写 Elm 代码的理想方式