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]: Error on creating a new project #363

Open
1 task done
fabriziodidthis opened this issue Jul 8, 2024 · 3 comments
Open
1 task done

[BUG]: Error on creating a new project #363

fabriziodidthis opened this issue Jul 8, 2024 · 3 comments
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@fabriziodidthis
Copy link

What happened?

Creating a new project running npm init octokit-project and answering all the questions, the project cannot be create due this error

? Do you want to create a public or private repository? public
? If you have access, do you want to create the repository in the @octokit organization? No
Open https://github.com/login/device
Paste code: ABCD-1234 (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/21
? 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-auth-random
? Description for npm package and the GitHub repository random
? What is the main export of the authentication strategy? (Example: "createRandomAuth" for "import { createRandomAuth } 
of 'octokit-auth-random'") createRandomAuth
? Provide the most simple standalone usage example for the authentication strategy, without the createRandomAuth 
import/require statement Received
? Provide the most simple usage example as Octokit authStrategy option, without the createRandomAuth and Octokit 
import/require statements Received
? Will the package work with Node? Yes
? Will the package work with browsers? Yes
? Full name of the repository (Example: fabriziodidthis/octokit-auth-random) fabriziodidthis/octokit-auth-random
? Value for "author" key in package.json Fabrizio Andre
? Email for Code of Conduct 
? Name for license Fabrizio Andre
? Folder path to initialize the project in, relative to current path. If the path does not yet exist it will be created. 
Current path is /Users/fabrizio/Repos) octokit-auth-random
Creating octokit-auth-random
$ git init
$ git checkout -b main
LICENSE created
CODE_OF_CONDUCT.md created
CONTRIBUTING.md created
node:internal/fs/promises:1206
    validateStringAfterArrayBufferView(data, 'data');
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Promise
    at writeFile (node:internal/fs/promises:1206:5)
    at writePrettyFile (file:///Users/fabrizio/.npm/_npx/b52e3113e4f00614/node_modules/create-octokit-project/lib/write-pretty-file.js:29:9)
    at async createCoc (file:///Users/fabrizio/.npm/_npx/b52e3113e4f00614/node_modules/create-octokit-project/lib/create-coc.js:21:3) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v21.7.0

Then, getting this error, I tried to run with npx create-octokit-project, and bumped into the same issue. Of course, but just for the sake of trying.

Anything it can be done to fix this?

Plus, since I have no idea what to answer to the questions
? What is the main export of the authentication strategy? (Example: "createRandomAuth" for "import { createRandomAuth } of 'octokit-auth-random'")

and

Provide the most simple standalone usage example for the authentication strategy, without the createRandomAuth import/require statement

and

Provide the most simple usage example as Octokit authStrategy option, without the createRandomAuth and Octokit import/require statements

I only pressed enter and let it continue as is.

Plus, the link for Code of conduct (when I need to check the box of it) is broken.

Versions

Octokit v4.1.1
Node v21.7.0
NPM v10.8.0

Relevant log output

0 verbose cli /Users/fabrizio/.nvm/versions/node/v21.7.0/bin/node /Users/fabrizio/.nvm/versions/node/v21.7.0/bin/npm
1 info using [email protected]
2 info using [email protected]
3 silly config load:file:/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/npmrc
4 silly config load:file:/Users/fabrizio/Repos/.npmrc
5 silly config load:file:/Users/fabrizio/.npmrc
6 silly config load:file:/Users/fabrizio/.nvm/versions/node/v21.7.0/etc/npmrc
7 verbose title npm init octokit-project
8 verbose argv "init" "octokit-project"
9 verbose logfile logs-max:10 dir:/Users/fabrizio/.npm/_logs/2024-07-07T23_44_06_744Z-
10 verbose logfile /Users/fabrizio/.npm/_logs/2024-07-07T23_44_06_744Z-debug-0.log
11 silly logfile start cleaning logs, removing 1 files
12 silly packumentCache heap:4345298944 maxSize:1086324736 maxEntrySize:543162368
13 silly logfile done cleaning log files
14 http fetch GET 200 https://registry.npmjs.org/create-octokit-project 915ms (cache revalidated)
15 silly packumentCache heap:4345298944 maxSize:1086324736 maxEntrySize:543162368
16 verbose stack Error: command failed
16 verbose stack     at promiseSpawn (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
16 verbose stack     at spawnWithShell (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
16 verbose stack     at promiseSpawn (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
16 verbose stack     at runScriptPkg (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:77:13)
16 verbose stack     at runScript (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
16 verbose stack     at run (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/node_modules/libnpmexec/lib/run-script.js:48:10)
16 verbose stack     at async exec (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:274:10)
16 verbose stack     at async Init.execCreate (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/lib/commands/init.js:136:5)
16 verbose stack     at async Init.exec (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/lib/commands/init.js:44:14)
16 verbose stack     at async Npm.exec (/Users/fabrizio/.nvm/versions/node/v21.7.0/lib/node_modules/npm/lib/npm.js:207:9)
17 error code 1
18 error path /Users/fabrizio/Repos
19 error command failed
20 error command sh -c create-octokit-project
21 verbose cwd /Users/fabrizio/Repos
22 verbose os Darwin 22.5.0
23 verbose node v21.7.0
24 verbose npm  v10.8.0
25 verbose exit 1
26 verbose code 1
27 error A complete log of this run can be found in: /Users/fabrizio/.npm/_logs/2024-07-07T23_44_06_744Z-debug-0.log

Code of Conduct

  • I agree to follow this project's Code of Conduct
@fabriziodidthis fabriziodidthis added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Jul 8, 2024
Copy link

github-actions bot commented Jul 8, 2024

👋 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! 🚀

@gr2m gr2m transferred this issue from octokit/octokit.js Jul 10, 2024

This comment has been minimized.

@gr2m
Copy link
Contributor

gr2m commented Jul 10, 2024

Thank you for letting us know! I moved it to the repository to the right repository

@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Jul 15, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

3 participants