Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpError:401 Unauthorized When Build Publish #7513

Closed
0raafi opened this issue Mar 30, 2023 · 1 comment
Closed

HttpError:401 Unauthorized When Build Publish #7513

0raafi opened this issue Mar 30, 2023 · 1 comment

Comments

@0raafi
Copy link

0raafi commented Mar 30, 2023

hallo i have an issue, i am can't publish electron. i have set GH_TOKEN in env variable but still got this error.

image

  • Electron-Builder Version: lates
  • Node Version: 14
    error log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'publish-package'
1 verbose cli ]
2 info using npm@6.14.17
3 info using node@v14.20.0
4 verbose run-script [ 'prepublish-package', 'publish-package', 'postpublish-package' ]
5 info lifecycle @~prepublish-package: @
6 info lifecycle @~publish-package: @
7 verbose lifecycle @~publish-package: unsafe-perm in lifecycle true
8 verbose lifecycle @~publish-package: PATH: C:\Users\Clodeo\AppData\Roaming\nvm\v14.20.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\works\vitamin-code\chat-marketplace\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Git\cmd;%NVM_HOME%;%NVM_SYMLINK%;C:\Program Files\Go\bin;C:\Users\Clodeo\AppData\Local\Microsoft\WindowsApps;C:\Users\Clodeo\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\Clodeo\go\bin;C:\Users\Clodeo\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle @~publish-package: CWD: C:\works\vitamin-code\chat-marketplace
10 silly lifecycle @~publish-package: Args: [ '/d /s /c', 'electron-builder build --publish always --win' ]
11 silly lifecycle @~publish-package: Returned: code: 1  signal: null
12 info lifecycle @~publish-package: Failed to exec publish-package script
13 verbose stack Error: @ publish-package: `electron-builder build --publish always --win`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\Clodeo\AppData\Roaming\nvm\v14.20.0\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:400:28)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\Clodeo\AppData\Roaming\nvm\v14.20.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:400:28)
13 verbose stack     at maybeClose (internal/child_process.js:1088:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
14 verbose pkgid @
15 verbose cwd C:\works\vitamin-code\chat-marketplace
16 verbose Windows_NT 10.0.19045
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "publish-package"
18 verbose node v14.20.0
19 verbose npm  v6.14.17
20 error code ELIFECYCLE
21 error errno 1
22 error @ publish-package: `electron-builder build --publish always --win`
22 error Exit status 1
23 error Failed at the @ publish-package script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

electron-builder.yaml

productName: "Kloola Chat"
appId: "org.erb.KloolaChat"
asar: true
asarUnpack: "**\\*.{nodedll}"
files:
  - "dist"
  - "node_modules"
  - "package.json"
afterSign: ".erb/scripts/notarize.js"
publish:
  provider: "github"
  owner: "0raafi"
  repo: "chat-marketplace"
  releaseType: "release"
  private: true
  publishAutoUpdate: false
mac:
  target:
    target: "default"
    arch:
      - "arm64"
      - "x64"
  type: "distribution"
  hardenedRuntime: true
  entitlements: "assets/entitlements.mac.plist"
  entitlementsInherit: "assets/entitlements.mac.plist"
  gatekeeperAssess: false
dmg:
  contents:
      - x: 130
        y: 220
      - x: 410
        y: 220
        type: "link"
        path: "/Applications"

win:
  target:
    - "nsis"
directories:
  app: "release/app"
  buildResources: "assets"
  output: "release/build"
extraResources:
  - "./assets/**"

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 1, 2023

Looking at your screenshot, your token is the issue.

{ "message": "Bad credentials", "documentation_url":.....}

@mmaietta mmaietta closed this as completed Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants