nicklayb / alfred-bitbucket

Workflow to get through your and your teams public / private repositories using App password
MIT License
38 stars 6 forks source link

Error: Cannot find module 'json-parse-better-errors' #30

Open billyromano opened 4 years ago

billyromano commented 4 years ago

Just upgraded to macOS Catalina this week and noticed my bitbucket workflow is missing. Re-installed the workflow, setup authentication and go to use the workflow and it's not working. Here's the error showing up in the debug console.

(node:35393) UnhandledPromiseRejectionWarning: /Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/read-pkg-up/node_modules/parse-json/index.js:1
Error: Cannot find module 'json-parse-better-errors'
Require stack:
- /Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/read-pkg-up/node_modules/parse-json/index.js
- /Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/read-pkg-up/node_modules/read-pkg/index.js
- /Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/read-pkg-up/index.js
- /Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/alfy/lib/update-notification.js
- /Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/alfy/index.js
- /Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/teams.js
    at Object.<anonymous> (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/read-pkg-up/node_modules/parse-json/index.js:3:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:35393) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:35393) UnhandledPromiseRejectionWarning: TypeError: updateNotification is not a function
    at /Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/alfy/index.js:14:1
    at Object.<anonymous> (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/alfy/index.js:166:3)
    at Generator.next (<anonymous>)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
(node:35393) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:35393) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
    at getDefaultUsername (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/config.js:32:42)
    at /Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/bitbucket/repoService.js:4:40
    at Object.<anonymous> (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/bitbucket/repoService.js:39:3)
    at Generator.next (<anonymous>)
(node:35393) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:35393) UnhandledPromiseRejectionWarning: TypeError: alfy.error is not a function
    at loginAttempt (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/authenticate.js:79:14)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:62:3)
(node:35393) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
nicklayb commented 4 years ago

How did you perform the installation? I did it yesterday on Catalina and didn't faced any errors.

billyromano commented 4 years ago

It's been a while since I've revisited this issue. I just tried to see if I can get this working again, and I'm running into another error. I uninstalled the npm package and reinstalled it using the latest node v15.0.1 and npm v6.14.8. I also followed the steps for adding the username and application key.

Error:

RequestError: Client network socket disconnected before secure TLS connection was established
    at ClientRequest.<anonymous> (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/got/source/request-as-event-emitter.js:178:14)
    at Object.onceWrapper (node:events:434:26)
    at ClientRequest.emit (node:events:339:22)
    at ClientRequest.EventEmitter.emit (node:domain:486:12)
    at ClientRequest.origin.emit (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/@szmarczak/http-timer/source/index.js:37:11)
    at TLSSocket.socketErrorListener (node:_http_client:478:9)
    at TLSSocket.emit (node:events:327:20)
    at TLSSocket.EventEmitter.emit (node:domain:486:12)
    at emitErrorNT (node:internal/streams/destroy:194:8)
    at emitErrorCloseNT (node:internal/streams/destroy:159:3)

-
BitBucket 1.5.1
Alfred 4.1.1
darwin 19.6.0`

  Debugger output:

[01:50:09.652] ERROR: BitBucket[Script Filter] Code 1: {
    "items": [
        {
            "title": "RequestError: Client network socket disconnected before secure TLS connection was established\n    at ClientRequest.<anonymous> (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/got/source/request-as-event-emitter.js:178:14)\n    at Object.onceWrapper (node:events:434:26)\n    at ClientRequest.emit (node:events:339:22)\n    at ClientRequest.EventEmitter.emit (node:domain:486:12)\n    at ClientRequest.origin.emit (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/@szmarczak/http-timer/source/index.js:37:11)\n    at TLSSocket.socketErrorListener (node:_http_client:478:9)\n    at TLSSocket.emit (node:events:327:20)\n    at TLSSocket.EventEmitter.emit (node:domain:486:12)\n    at emitErrorNT (node:internal/streams/destroy:194:8)\n    at emitErrorCloseNT (node:internal/streams/destroy:159:3)",
            "subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
            "valid": false,
            "text": {
                "copy": "```\nRequestError: Client network socket disconnected before secure TLS connection was established\n    at ClientRequest.<anonymous> (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/got/source/request-as-event-emitter.js:178:14)\n    at Object.onceWrapper (node:events:434:26)\n    at ClientRequest.emit (node:events:339:22)\n    at ClientRequest.EventEmitter.emit (node:domain:486:12)\n    at ClientRequest.origin.emit (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/@szmarczak/http-timer/source/index.js:37:11)\n    at TLSSocket.socketErrorListener (node:_http_client:478:9)\n    at TLSSocket.emit (node:events:327:20)\n    at TLSSocket.EventEmitter.emit (node:domain:486:12)\n    at emitErrorNT (node:internal/streams/destroy:194:8)\n    at emitErrorCloseNT (node:internal/streams/destroy:159:3)\n```\n\n-\nBitBucket 1.5.1\nAlfred 4.1.1\ndarwin 19.6.0",
                "largetype": "RequestError: Client network socket disconnected before secure TLS connection was established\n    at ClientRequest.<anonymous> (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/got/source/request-as-event-emitter.js:178:14)\n    at Object.onceWrapper (node:events:434:26)\n    at ClientRequest.emit (node:events:339:22)\n    at ClientRequest.EventEmitter.emit (node:domain:486:12)\n    at ClientRequest.origin.emit (/Users/username/.npm-packages/lib/node_modules/alfred-bitbucket/node_modules/@szmarczak/http-timer/source/index.js:37:11)\n    at TLSSocket.socketErrorListener (node:_http_client:478:9)\n    at TLSSocket.emit (node:events:327:20)\n    at TLSSocket.EventEmitter.emit (node:domain:486:12)\n    at emitErrorNT (node:internal/streams/destroy:194:8)\n    at emitErrorCloseNT (node:internal/streams/destroy:159:3)"
            },
            "icon": {
                "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
            }
        }
    ]
}