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

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

Open
1 task done
gbidkar-capsule opened this issue Jan 2, 2025 · 3 comments · May be fixed by #401
Open
1 task done

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

gbidkar-capsule opened this issue Jan 2, 2025 · 3 comments · May be fixed by #401
Labels
Type: Bug Something isn't working as documented

Comments

@gbidkar-capsule
Copy link

gbidkar-capsule commented Jan 2, 2025

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:
[email protected]
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

[email protected]
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
@gbidkar-capsule gbidkar-capsule added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@github-project-automation github-project-automation bot moved this to 🆕 Triage in 🧰 Octokit Active Jan 2, 2025
wolfy1339 added a commit that referenced this issue Feb 12, 2025
There is an issue with `inquirer` where the `answers` argument to the `validation()` function is undefined, according to the docs, that argument should be passed, but it isn't

Fixes #396
@wolfy1339 wolfy1339 linked a pull request Feb 12, 2025 that will close this issue
4 tasks
@69814059
Copy link

help fix this

@wolfy1339
Copy link
Member

I have a fix in #401

@wolfy1339 wolfy1339 moved this from 🆕 Triage to 🏗 In progress in 🧰 Octokit Active Feb 17, 2025
@wolfy1339 wolfy1339 removed the Status: Triage This is being looked at and prioritized label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

3 participants