# Clarification on Package Names and Versions

**URL:** https://discourse.nixos.org/t/clarification-on-package-names-and-versions/9819
**Category:** Help
**Created:** [November 2, 2020, 6:31pm UTC](https://discourse.nixos.org/t/clarification-on-package-names-and-versions/9819 "2020-11-02T18:31:20Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![milahu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/milahu/32/4006_2.png) [@milahu](https://discourse.nixos.org/u/milahu)
#### Post date: [October 30, 2021, 9:32pm UTC](https://discourse.nixos.org/t/clarification-on-package-names-and-versions/9819/8 "2021-10-30T21:32:18Z")

</div>

> [@jeff-hykin](#):
>
> There seem to be naming constraints, which look like they need to match the following regex `[a-zA-Z0-9_][.-+a-zA-Z0-9_]`  
> However, I do not know of official requirements.

> <https://github.com/NixOS/nix/blob/888771b4b2f153bfbf203e07d768d577ab2343e8/src/libstore/path.cc#L5-L17>

how did i find this?

```sh
# generate error message
nix-build -E 'with import <nixpkgs> { }; callPackage (stdenv.mkDerivation { name = ", invalid"; }) { }' 
error: store path 'xxxx-, invalid' contains illegal character ','

# get nix source
git clone https://github.com/NixOS/nix --depth 1

# find error message
grep -rHn 'contains illegal character' nix/
nix/src/libstore/path.cc:16: throw BadStorePath("store path '%s' contains illegal character '%s'", path, c);

```

---

_[View the full topic](https://discourse.nixos.org/t/clarification-on-package-names-and-versions/9819)._
