# VS code error

**URL:** https://discourse.julialang.org/t/vs-code-error/45349
**Category:** VS Code
**Created:** [August 22, 2020, 3:48am UTC](https://discourse.julialang.org/t/vs-code-error/45349 "2020-08-22T03:48:02Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [August 22, 2020, 3:48am UTC](https://discourse.julialang.org/t/vs-code-error/45349/1 "2020-08-22T03:48:03Z")

</div>

I get this error when I try to run Julia REPL in VS Code (Windows 10):

```julia
ERROR: LoadError: IOError: mkdir: invalid argument (EINVAL)
Stacktrace:
 [1] uv_error at .\libuv.jl:97 [inlined]
 [2] mkdir(::String; mode::UInt16) at .\file.jl:177
 [3] mkpath(::String; mode::UInt16) at .\file.jl:227
 [4] mkpath(::String; mode::UInt16) at .\file.jl:225 (repeats 8 times)
 [5] mkpath at .\file.jl:222 [inlined]
 [6] compilecache_path(::Base.PkgId) at .\loading.jl:1228     
 [7] compilecache(::Base.PkgId, ::String) at .\loading.jl:1258
 [8] _require(::Base.PkgId) at .\loading.jl:1030
 [9] require(::Base.PkgId) at .\loading.jl:928
 [10] require(::Module, ::Symbol) at .\loading.jl:923
 [11] include(::Function, ::Module, ::String) at .\Base.jl:380
 [12] include(::Module, ::String) at .\Base.jl:368
 [13] exec_options(::Base.JLOptions) at .\client.jl:296       
 [14] _start() at .\client.jl:506
in expression starting at c:\Users\PKrysl\Documents\work\Portable_Julia\VSCode-win32-x64-1.48.1\data\extensions\julialang.language-julia-1.0.4\scripts\terminalserver\terminalserver.jl:5
MethodError: objects of type Bool are not callable

```

The line 5 in the terminalserver is `using VSCodeServer`.  
I print out LOAD\_PATH:

```julia
["@", "@v#.#", "@stdlib", "c:\\Users\\PKrysl\\Documents\\work\\Portable_Julia\\VSCode-win32-x64-1.48.1\\data\\extensions\\julialang.language-julia-1.0.4\\scripts\\terminalserver\\..\\packages"]

```

Does it strike you as wrong?

PS: I guess it is not the path: the same path works fine when VS Code is started from the Powershell  
via git bash.

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [August 22, 2020, 5:30pm UTC](https://discourse.julialang.org/t/vs-code-error/45349/2 "2020-08-22T17:30:13Z")

</div>

The path looks good to me. This looks a bit as if something is going wrong when it tries to precompile the `VSCodeServer` module. I’m wondering whether we are running into the problem that if two instances of Julia try to precompile the same module at the same time, one will crash…

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [August 22, 2020, 5:33pm UTC](https://discourse.julialang.org/t/vs-code-error/45349/3 "2020-08-22T17:33:46Z")

</div>

I do not know whether two Julias might be running, but I am running only a single instance of vscode.

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [August 22, 2020, 5:39pm UTC](https://discourse.julialang.org/t/vs-code-error/45349/4 "2020-08-22T17:39:11Z")

</div>

Then it is something else 🙂

Maybe this is related to the portable Julia stuff? Is that using the normal `~/.julia` folder for precompile caches?

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [August 22, 2020, 6:11pm UTC](https://discourse.julialang.org/t/vs-code-error/45349/5 "2020-08-22T18:11:13Z")

</div>

I start VS code (portable) by double-clicking either the Windows batch file or the bash file ([Portable Julia - #5 by PetrKryslUCSD](https://discourse.julialang.org/t/portable-julia/45339/5)).

The former doesn’t work: when I start Julia I get the error above. The latter works without problems.

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [August 22, 2020, 8:43pm UTC](https://discourse.julialang.org/t/vs-code-error/45349/6 "2020-08-22T20:43:24Z")

</div>

Should there be a backslah instead of a dot `.` in `set MyDepot="%MyPortableJuliaDir%.%MyPortableJulia%-depot"` in the batch file?

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [August 22, 2020, 9:42pm UTC](https://discourse.julialang.org/t/vs-code-error/45349/7 "2020-08-22T21:42:32Z")

</div>

MyPortableJuliaDir has a \ attached at the end. The . is to emulate the .julia naming convention.

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [August 23, 2020, 1:02am UTC](https://discourse.julialang.org/t/vs-code-error/45349/8 "2020-08-23T01:02:39Z")

</div>

Hm, weird… I think at the end of the day this must come down to some different value for the env vars depending on whether you start it from bash or the batch file?

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [August 23, 2020, 1:07am UTC](https://discourse.julialang.org/t/vs-code-error/45349/9 "2020-08-23T01:07:34Z")

</div>

I gave up on it. Truth be told, I don’t particularly enjoy writing Windows batch files. I wrote a bash script which does what I want, and can be run using the same double-click procedure as a batch file.
