Skip to content

[BUG]: Crashing after npm package name input (isPlugin is undefined) #396

@gbidkar-capsule

Description

@gbidkar-capsule

What happened?

Trying to run npm init octokit-project, while trying to create a private repository of an authentication strategy, is failing claiming the answer to isPlugin is undefined. Used answer defaults with Enter and did not provide an explicit n to the is plugin answer, maybe it effected inquirer?

Flow:

npm init octokit-project                                                                                                                                                               02:44:02 PM
Need to install the following packages:
create-octokit-project@4.1.4
Ok to proceed? (y) 


> npx
> create-octokit-project

✔ Do you want to create a public or private repository? private
✔ If you have access, do you want to create the repository in the @octokit organization? No
Open https://github.com/login/device
Paste code: XXXX-XXXX (copied to your clipboard)
✔ Press <enter> when ready Yes
> GET /user
  accept: application/vnd.github.v3+json
  user-agent: octokit-core.js/6.1.2 Node.js/22
✔ Is the project an Octokit plugin? No
✔ Is the project an Octokit authentication strategy? Yes
? What npm package name should the project have? (Example: octokit-auth-example) octokit-private-authfile:///Users/bidkar/.npm/_npx/04d5fd1ce1412622/node_modules/create-octokit-project/lib/prompts.js:55
        if (answers.isPlugin) {
                    ^

TypeError: Cannot read properties of undefined (reading 'isPlugin')
    at validate (file:///Users/bidkar/.npm/_npx/04d5fd1ce1412622/node_modules/create-octokit-project/lib/prompts.js:55:21)
    at Object.<anonymous> (file:///Users/bidkar/.npm/_npx/04d5fd1ce1412622/node_modules/@inquirer/input/dist/esm/index.js:21:86)
    at file:///Users/bidkar/.npm/_npx/04d5fd1ce1412622/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js:12:25
    at ReadStream.wrapped (file:///Users/bidkar/.npm/_npx/04d5fd1ce1412622/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js:50:29)
    at AsyncResource.runInAsyncScope (node:async_hooks:211:14)
    at ReadStream.bound (node:async_hooks:242:16)
    at ReadStream.emit (node:events:530:35)
    at emitKeys (node:internal/readline/utils:370:14)
    at emitKeys.next (<anonymous>)
    at ReadStream.onData (node:internal/readline/emitKeypressEvents:64:36)

Node.js v22.11.0
npm error code 1
npm error path /Users/bidkar/code
npm error command failed
npm error command sh -c create-octokit-project
npm error A complete log of this run can be found in: /Users/bidkar/.npm/_logs/2025-01-02T12_44_03_493Z-debug-0.log

Versions

create-octokit-project@4.1.4
Node.js v22.11.0
ohmyzsh shell
Latest MacOS

Relevant log output

729 verbose stack Error: command failed
729 verbose stack     at promiseSpawn (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
729 verbose stack     at spawnWithShell (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
729 verbose stack     at promiseSpawn (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
729 verbose stack     at runScriptPkg (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:77:13)
729 verbose stack     at runScript (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
729 verbose stack     at run (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/node_modules/libnpmexec/lib/run-script.js:48:10)
729 verbose stack     at async exec (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:298:10)
729 verbose stack     at async Init.execCreate (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/lib/commands/init.js:135:5)
729 verbose stack     at async Init.exec (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/lib/commands/init.js:44:14)
729 verbose stack     at async Npm.exec (/Users/bidkar/.nvm/versions/node/v22.11.0/lib/node_modules/npm/lib/npm.js:207:9)
730 error code 1
731 error path /Users/bidkar/code
732 error command failed
733 error command sh -c create-octokit-project
734 verbose cwd /Users/bidkar/code
735 verbose os Darwin 24.2.0
736 verbose node v22.11.0
737 verbose npm  v10.9.0
738 verbose exit 1
739 verbose code 1
740 error A complete log of this run can be found in: /Users/bidkar/.npm/_logs/2025-01-02T12_44_03_493Z-debug-0.log

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    🏗 In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions