So your Chrome app is ready to go? Awesome! You’re packing it up to test on all your devices when suddenly… A private key for specified extension already exists. Reuse that key or delete it first.
The Pack Extension Error is actually a pretty simple one to get around. It’s caused because the extension has already been packed in the past, and Chrome automatically created a private key for the package.
The automatically created key has the same filename as the folder you selected, and is in the same parent folder as your extension, You can choose to either delete it (and another will be created next build) or select the key from the dialog.
Chrome CRX Keys
Each Chrome app is signed with a key, and if you don’t specify one it’s automatically created for you.
You can see from the command line below that the pack-extension command creates both a crx (extension) and a pem (key) file.
$ ls build-chrome build-chrome.sh chrome.zip libs $ google-chrome --pack-extension=build-chrome/ Created the following files: Extension: build-chrome.crx Key File: build-chrome.pem Keep your key file in a safe place. You will need it to create new versions of your extension. $ ls build-chrome build-chrome.pem chrome.zip build-chrome.crx build-chrome.sh libs
The next time we run the pack-extension command above it will fail because we also need to specify the
--pack-extension-key parameter like so:
$ google-chrome --pack-extension=build-chrome/ --pack-extension-key=build-chrome.pem
None of this is particularly obvious from within Chrome itself, which just gives you the unhelpful Pack Extension Error dialog box. It’s a fairly easy fix though, just hit “Browse…” and the pem file should be right there.