# `package.licence_not_allowed`

An installed package says its licence is proprietary, but it wasn't installed from a git repository.

Area 11, [External services](/docs/external-services.md); not declinable; the next step is usually the human's.

## Why Jadpo refuses it

A proprietary package is private code that only its owner may use, such
as your company's own package. Private packages come from git, with your
own access to the repository. A package from anywhere else, such as a
folder, is one others may use, so it carries an open licence.

Jadpo won't choose for you whether the package is private or open, or
where it should come from. That decides who may use the code, and only
its owner can say.

## What it looks like


`Postcodes.v2` says it is proprietary, and the lock shows it was installed
from a folder, `path ../postcodes`.

packages/postcodes/v2/package.jadpo:

```jadpo
/// UK postcodes.
package Postcodes.v2 {
    licence: Licence.proprietary
    jadpo: "1.0"
}
```

jadpo.lock:

```jadpo
// Generated by Jadpo from the installed packages; update it with `jadpo package add`, `update` or `remove`, never by hand.
record lock 1

package Postcodes.v2 version 2.1.0 path ../postcodes digest sha256:3fcf79f4803b01a5f2f4a9ff6550c4ee20fe3a4e93e608faa0c447eabf6a3191
```

```text
error: Package `Postcodes.v2` is proprietary but wasn't installed from git
 --> packages/postcodes/v2/package.jadpo:3:5
  |
3 |     licence: Licence.proprietary
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ proprietary
  reason: Only a package installed from git, a company's private package, may be `Licence.proprietary`; the registry and other sources carry packages others may use.
  next: Install the package from its git repository, or publish it under one of the open licences (human)
  rule: package.licence_not_allowed
  help: https://jadpo.dev/docs/errors/package.licence_not_allowed

check failed: 1 error, 2 files
```

`(human)` at the end of the `next:` line tells your coding agent to stop
and ask you which fix you want, because the choice is yours to make: it
decides whether `Postcodes` is private code or open for others to use.

## How to fix it

The question is whose code `Postcodes` is, and who may use it.

**If it is your company's private package**, install it from its git
repository at a release tag instead of from the folder:

```sh
jadpo package remove postcodes
jadpo package add github.com/acme/postcodes@v2.1.0
```

The lock records the repository, the tag and its commit. A package from
git needs a person's acceptance in the change that installs it.

**If it should be open**, change its licence to an open one in the
package's own source, then install it again. The index becomes:

```jadpo
    licence: Licence.mit
```




Anyone may now use the package under the MIT licence, and installing it
from a folder is allowed.

**If it is your app's own code**, move it to
`shared/providers/postcodes/v2/`, where the app's own integrations live,
and remove the installed copy with `jadpo package remove postcodes`. The
app's own code may be proprietary. `shared/providers/postcodes/v2/package.jadpo`:

```jadpo
/// UK postcodes.
package Postcodes.v2 {
    licence: Licence.proprietary
    jadpo: "1.0"
}
```


`Postcodes.v2` is now part of your app, which may change it, and the lock
no longer lists it.

## Related

- [The index: `package.jadpo`](/docs/the-package-format.md#the-index-packagejadpo)
- [Private packages come from git](/docs/developing-and-publishing-a-package.md#private-packages-come-from-git)
- [Installing safely](/docs/where-packages-come-from.md#installing-safely)
- [Where packages live](/docs/where-packages-live.md)
