Electron-builder: Error: Cannot detect repository by .git/config. Please specify "repository" in the package.json

Created on 23 Aug 2017  路  8Comments  路  Source: electron-userland/electron-builder

  • Version:
    19.24.1

  • Target:
    Mac

Failed with this error.

Error: Cannot detect repository by .git/config. Please specify "repository" in the package.json (https://docs.npmjs.com/files/package.json#repository).
Please see https://github.com/electron-userland/electron-builder/wiki/Publishing-Artifacts
    at /Users/berton/workspace/git/project/node_modules/[email protected]@electron-builder/src/publish/PublishManager.ts:499:13

I am using gitlab for managing my project, and the repository field is:

"repository": {
  "type": "git",
  "url": "[email protected]:group/project.git"
 },

Maybe a github repository is necessary for publishing but I don't need it.

I tried to add --publish never, no work.

bug

Most helpful comment

I tried to publish the build to bintray with gitlab. It gave the same error. It would be nice to handle such a case too.

All 8 comments

After I set repository.url to https://github.com/electron-userland/electron-builder.git, it build success.

Please set "publish": null in the configuration to disable publishing.

Solution: we should detect such case and disable default github provider.

I tried to publish the build to bintray with gitlab. It gave the same error. It would be nice to handle such a case too.

Is this bug going to get addressed as its 2yrs old now?

any solution ? This is 2 years since issue labeled as bug.

Did you add publish config in your package.json ?
You can read the docs about it(https://www.electron.build/configuration/publish)

Example:

{
 "devDependencies":{},
"build": {
  "publish": [
      {
        "provider": "generic",
        "url": "http://download.ydstatic.com/notewebsite/downloads/meeting/"
      }
    ]
  }
}

Remember publish belongs to build config

@meowtec solution worked for me, but seems silly I have to add this to get it to work

Was this page helpful?
0 / 5 - 0 ratings