'A private key for specified extension already exists. Reuse that key or delete it first

Im trying to add a new extension for google chrome.(im new to this).

I keep getting the error message "A Private key for specified extension already exists. Reuse that key or delete it first".

{
   "manifest_version": 2,
   "description": "test",

   "name": "test",
   "version": "2.1",

   "content_scripts": [
 {
      "matches": ["*://www.google.com*"],
    "js": ["script.js"]

   }



  ]
}


Solution 1:[1]

In the root folder where your extension is located, there is a .pem file. Simply delete it.

Solution 2:[2]

I was dealing with that issue too. I changed the root folder name (that contained my manifest and js files) from "extension" to something else like "chromeext" and I was able to pack the extension successfully.

Solution 3:[3]

Bumping this thread with a (possible) fix for others : the extension folder name must not contain spaces. E.g. change My Extension Folder to MyExtensionFolder.

Solution 4:[4]

When you try to Pack Extension it creates a private key with the extension of .pem. Follow this link:

https://stackoverflow.com/questions/50615890/what-is-the-chrome-extension-pem-file-for

This is because you executed extension, it is located in your parent folder. It will appear once you execute it. You need to delete it. enter image description here

This can be a one unique key only. So when you execute it again, it will throw again as already a private key exists.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jeremy Caney
Solution 2 takanuva15
Solution 3 Anthony Saint-Criq
Solution 4 silvachathura