# Resolving package identifier ... as a directory

**URL:** <https://discourse.julialang.org/t/resolving-package-identifier-as-a-directory/53499>\
**Category:** General Usage\
**Tags:** pkg\
**Created:** [January 17, 2021, 8:40pm UTC](https://discourse.julialang.org/t/resolving-package-identifier-as-a-directory/53499 "2021-01-17T20:40:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [January 17, 2021, 8:40pm UTC](https://discourse.julialang.org/t/resolving-package-identifier-as-a-directory/53499/1 "2021-01-17T20:40:18Z")

</div>

Hello, i am creating a new package _A_. After i ativate it, i add another package _B_ i already wrote and published.  
I get this:

```julia
(A) pkg> add B
[ Info: Resolving package identifier `B` as a directory at `C:\Users\congedom\Documents\Code\julia\B`.

```

So, instead of adding the package from Julia’s registry it adds it from my PC. I didn’t see this before. How should i specify to add it from the registry?

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [January 17, 2021, 9:28pm UTC](https://discourse.julialang.org/t/resolving-package-identifier-as-a-directory/53499/2 "2021-01-17T21:28:54Z")

</div>

I locally tested it on Linux and this doesn’t happen for me 😕

But did you try to `free B`?  
[From the manual](https://julialang.github.io/Pkg.jl/v1/managing-packages/#Adding-packages)

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [January 17, 2021, 9:37pm UTC](https://discourse.julialang.org/t/resolving-package-identifier-as-a-directory/53499/3 "2021-01-17T21:37:30Z")

</div>

That does not work either. When I call `free` It says that B is expected to ‘to be pinned, tracking a path, or tracking a repository’, which i didn’t. I am using Windows.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [January 17, 2021, 10:29pm UTC](https://discourse.julialang.org/t/resolving-package-identifier-as-a-directory/53499/4 "2021-01-17T22:29:28Z")

</div>

I think if you change the current working directory (with `cd` or by starting julia from a different folder) then it won’t see the local package in the current folder and will instead add it from the registry. (I think you are running into [`add Desktop` confused by existing local directory with name of registered package · Issue #1941 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/1941)).

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [January 17, 2021, 10:50pm UTC](https://discourse.julialang.org/t/resolving-package-identifier-as-a-directory/53499/5 "2021-01-17T22:50:40Z")

</div>

Indeed adding the package as `Pkg.add("B")`, as suggested in the issue, works fine (i was adding by `]add B` and this runs into the issue). Thanks!

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [January 17, 2021, 10:57pm UTC](https://discourse.julialang.org/t/resolving-package-identifier-as-a-directory/53499/6 "2021-01-17T22:57:25Z")

</div>

Ah, that’s an even better fix!
