pkg> add JSON
INFO: Resolving package versions
INFO: Cloning [682c06a0-de6a-54ab-a142-c8b1cf79cde6] JSON
ERROR: GitError(Code:ERROR, Class:OS, Failed to make directory 'C:\Users\tshort\.julia\upstream\682c06a0-de6a-54ab-a142-c8b1cf79cde6': The system cannot find the path specified.
)
Stacktrace:
[1] macro expansion at .\libgit2\error.jl:99 [inlined]
[2] clone(::String, ::String, ::Base.LibGit2.CloneOptions) at .\libgit2\repository.jl:276
[3] #clone#100(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::String, ::String) a
t .\libgit2\libgit2.jl:562
[4] (::Base.LibGit2.#kw##clone)(::Array{Any,1}, ::Base.LibGit2.#clone, ::String, ::String) at .\<missing>:0
[5] install(::Pkg3.Types.EnvCache, ::Base.Random.UUID, ::String, ::Pkg3.Types.SHA1, ::Array{String,1}, ::VersionNumber) at C:
\Users\tshort\.julia\v0.6\Pkg3\src\Operations.jl:205
[6] apply_versions(::Pkg3.Types.EnvCache, ::Array{Pkg3.Types.PackageVersion,1}) at C:\Users\tshort\.julia\v0.6\Pkg3\src\Oper
ations.jl:291
[7] add(::Pkg3.Types.EnvCache, ::Array{Pkg3.Types.PackageVersion,1}) at C:\Users\tshort\.julia\v0.6\Pkg3\src\Operations.jl:3
51
[8] do_add!(::Pkg3.Types.EnvCache, ::Array{Tuple{Symbol,Vararg{Any,N} where N},1}) at C:\Users\tshort\.julia\v0.6\Pkg3\src\R
EPLMode.jl:156
[9] do_cmd(::Base.REPL.LineEditREPL, ::String) at C:\Users\tshort\.julia\v0.6\Pkg3\src\REPLMode.jl:109
[10] (::Pkg3.REPLMode.##3#4{Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Ar
ray{UInt8,1}}, ::Bool) at C:\Users\tshort\.julia\v0.6\Pkg3\src\REPLMode.jl:208
julia> versioninfo()
Julia Version 0.6.0
Commit 903644385b* (2017-06-19 13:05 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, skylake)
Thanks for the report! What's the result of the following on your system:
julia> homedir()
"/Users/stefan"
julia> joinpath(homedir(), ".julia")
"/Users/stefan/.julia"
julia> homedir()
"C:\\Users\\tshort"
julia> joinpath(homedir(), ".julia")
"C:\\Users\\tshort\\.julia"
Also, I see a copy/paste error in the directory location above. There's a bracket missing. I'll fix that. Actually, multiple errors in username (I'm trying to mask the real name).
I just repeated this on another Windows machine. Same error. On Linux, it works fine.
Does C:\Users\tshort\.julia\upstream exist? If not, does mkpath("C:\\Users\\tshort\\.julia\\upstream") create it?
That directory didn't exist. The mkpath statement did create it. Once manually created, the add JSON command now works.
Ok, I pushed a potential fix 鈥撀爈et me know if it works. You'll have to delete .julia/{upstream,packages} in order to test out if it gets created automatically now. Seems like libgit2 may have a different behavior on Windows in terms of creating parent directories.
That fixed it. I zapped the relevant folders under .julia before retrying it.
Most helpful comment
That fixed it. I zapped the relevant folders under
.juliabefore retrying it.