Problem adding IJulia as a package dependency

I have writen a small script (GitHub - BacAmorim/ijuliaup: Simple script to help remove/add IJulia kernels after updating Julia.) that provides a convient way of removing and adding new IJulia kernels (with multiple threads) after Julia is updated.

I am trying to convert this script into a package. The script installs IJulia, but with a package I should not need to do this as I can just add IJulia as a dependency. In the package folder, I activate the environment and after that I do Pkg.add("IJulia").

However, when I then try to use the package I get the following error:

ERROR: LoadError: ArgumentError: Package IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

instantiate-ing does not solve the problem. IJulia also appears in the Project.toml file. I only seem to get this problem when adding IJulia as a dependency.
Anyone knows what might be going on?