# Error: Missing source file for JSON

**URL:** <https://discourse.julialang.org/t/error-missing-source-file-for-json/67975>\
**Category:** General Usage\
**Tags:** package-manager\
**Created:** [September 10, 2021, 9:12am UTC](https://discourse.julialang.org/t/error-missing-source-file-for-json/67975 "2021-09-10T09:12:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sim/32/22207_2.png) [@sim](https://discourse.julialang.org/u/sim)\
**Post date:** [September 10, 2021, 9:12am UTC](https://discourse.julialang.org/t/error-missing-source-file-for-json/67975/1 "2021-09-10T09:12:34Z")

</div>

Hi, on a fresh installation of Julia on Ubuntu 16.04, I cannot install packages. Each `add Pkgname` results in a

> 1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

and `Pkg.precompile()` always gives me

> ERROR: The following 1 direct dependency failed to precompile:
> 
> JSON [682c06a0-de6a-54ab-a142-c8b1cf79cde6]
> 
> Error: Missing source file for JSON [682c06a0-de6a-54ab-a142-c8b1cf79cde6  
> Stacktrace:  
> [1] pkgerror(msg::String)  
> @ Pkg.Types /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:55  
> [2] precompile(ctx::Pkg.Types.Context; internal\_call::Bool, strict::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})  
> @ Pkg.API /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1265  
> [3] precompile  
> @ /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:921 [inlined]  
> [4] #precompile#196  
> @ /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:919 [inlined]  
> [5] precompile()  
> @ Pkg.API /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:919  
> [6] top-level scope  
> @ REPL[28]:1

Does someone have an idea on this ?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [September 10, 2021, 3:34pm UTC](https://discourse.julialang.org/t/error-missing-source-file-for-json/67975/2 "2021-09-10T15:34:41Z")

</div>

What is the output of

```julia
ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0
import Pkg
Pkg.add("JSON")

```

?

---

<div class="post-metadata">

**Author:** ![sim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sim/32/22207_2.png) [@sim](https://discourse.julialang.org/u/sim)\
**Post date:** [September 13, 2021, 6:44am UTC](https://discourse.julialang.org/t/error-missing-source-file-for-json/67975/3 "2021-09-13T06:44:29Z")

</div>

Hi Fredrik, here is the output :

> julia\> ENV[“JULIA\_PKG\_PRECOMPILE\_AUTO”]=0  
> 0
> 
> julia\> import Pkg
> 
> julia\> Pkg.add(“JSON”)  
> Resolving package versions…  
> No Changes to `~/.julia/environments/v1.6/Project.toml`  
> No Changes to `~/.julia/environments/v1.6/Manifest.toml`

---

<div class="post-metadata">

**Author:** ![sim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sim/32/22207_2.png) [@sim](https://discourse.julialang.org/u/sim)\
**Post date:** [September 17, 2021, 1:51pm UTC](https://discourse.julialang.org/t/error-missing-source-file-for-json/67975/4 "2021-09-17T13:51:42Z")

</div>

@fredrikekre But even after this, `using JSON` still outputs the same error (see the first message).

---

<div class="post-metadata">

**Author:** ![aateg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aateg/32/47963_2.png) [@aateg](https://discourse.julialang.org/u/aateg)\
**Post date:** [March 22, 2023, 11:21am UTC](https://discourse.julialang.org/t/error-missing-source-file-for-json/67975/5 "2023-03-22T11:21:17Z")

</div>

I am not sure if the problem persists, but I will try to answer for other people with the same problem.

Following the discussion [here](https://discourse.julialang.org/t/error-i-cannot-install-package-meshes/84051).

JSON package might be borked. Remove the JSON package from `.julia/packages` and then try installing JSON again.

To avoid this problem is recommended to use [environments](https://pkgdocs.julialang.org/v1/environments/).

I was facing a similar problem and I removed completely `.julia` directory. Installing again the desired package worked
