Closed jarcane closed 6 years ago
Ah, it looks like this is a mistake in the error handling -- I think there's actually no problem connecting to package.elm-lang.org, but there is another error being thrown, and that message is mistakenly printed.
It looks like the real error here is that it can't open the log file it's trying to write: ENOENT: no such file or directory, open 'C:\projects\elm-dice\elm-upgrade-2018-09-03T08:32:00.589Z.log'
I assume you have write access to that folder?, so something must be wrong with the code for opening files on Windows.
Can someone try the following in nodejs in Windows and see if it fails? (And if it does, can you figure out how to make it work?)
// First delete `test.log` if it exists in the current directory
// Then run the following in `node`:
var fs = require('fs');
var fd = fs.openSync("test.log", "ax");
fs.writeSync(fd, "hello");
fs.closeSync(fd);
@avh4 I actually tried running it in Administrator mode even just to rule out rights issues, but I get the same error.
Running your snippet in node I get the expected file output with no errors.
Ah, I'm guessing it's the :
characters in the log file's name. Does this fail on Windows?
var fs = require('fs');
var fd = fs.openSync("test-00:00.log", "ax");
fs.writeSync(fd, "hello");
fs.closeSync(fd);
If that indeed was the root cause, then it's fixed in elm-upgrade@0.19.4
@avh4 The snippet runs without error, but the resulting filename truncates after the :
, so it just outputs test-00
.
However I'm unable to install the update now. On both Win and WSL/Ubuntu I get an error: ENOENT: no such file or directory, chmod '/usr/lib/node_modules/elm-upgrade/upgrade.js'
I've made a gist of the full logs: https://gist.github.com/jarcane/cd197f272c287a5f024ab7a301362bb3
@jarcane the new problem you ran into was fixed in https://github.com/avh4/elm-upgrade/pull/63 with elm-upgrade@0.19.6
Trying to upgrade a small elm project on Windows 10 and it's failing, seemingly because it fails to connect to the package server. I can ping the URL and visit it just fine, so I'm not sure this is actually a problem on the server end. It also seems to have an issue writing logs.
Stacktrace: