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

npm init @knip/config fails on SVN repository #752

Open
guillaumebrunerie opened this issue Aug 9, 2024 · 1 comment
Open

npm init @knip/config fails on SVN repository #752

guillaumebrunerie opened this issue Aug 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@guillaumebrunerie
Copy link

Reproduction url

N/A

Description of the issue

Running npm init @knip/config on an svn repository fails hard. It should either not fail, or fail with a clearer error message ("@knip/config only supports git repositories") and in that case be explained in the docs.

$ npm init @knip/config                                                                                                                                                                                                        [16:09]
Need to install the following packages:
@knip/[email protected]
Ok to proceed? (y)


> [email protected] npx
> create-config

fatal: not a git repository (or any of the parent directories): .git
node:internal/errors:984
  const err = new Error(message);
              ^

Error: Command failed: git rev-parse --show-toplevel
fatal: not a git repository (or any of the parent directories): .git

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at getPackageManager (file:///Users/guillaumeb/.npm/_npx/017255d4efcf138c/node_modules/@knip/create-config/index.js:14:26)
    at main (file:///Users/guillaumeb/.npm/_npx/017255d4efcf138c/node_modules/@knip/create-config/index.js:28:14)
    at file:///Users/guillaumeb/.npm/_npx/017255d4efcf138c/node_modules/@knip/create-config/index.js:44:1
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7) {
  status: 128,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(69) [Uint8Array] [
      102,  97, 116,  97, 108,  58,  32, 110, 111, 116,  32,
       97,  32, 103, 105, 116,  32, 114, 101, 112, 111, 115,
      105, 116, 111, 114, 121,  32,  40, 111, 114,  32,  97,
      110, 121,  32, 111, 102,  32, 116, 104, 101,  32, 112,
       97, 114, 101, 110, 116,  32, 100, 105, 114, 101,  99,
      116, 111, 114, 105, 101, 115,  41,  58,  32,  46, 103,
      105, 116,  10
    ]
  ],
  pid: 20595,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(69) [Uint8Array] [
    102,  97, 116,  97, 108,  58,  32, 110, 111, 116,  32,
     97,  32, 103, 105, 116,  32, 114, 101, 112, 111, 115,
    105, 116, 111, 114, 121,  32,  40, 111, 114,  32,  97,
    110, 121,  32, 111, 102,  32, 116, 104, 101,  32, 112,
     97, 114, 101, 110, 116,  32, 100, 105, 114, 101,  99,
    116, 111, 114, 105, 101, 115,  41,  58,  32,  46, 103,
    105, 116,  10
  ]
}

Node.js v21.6.1
npm error code 1
npm error path [...]
npm error command failed
npm error command sh -c create-config
npm error A complete log of this run can be found in: /Users/guillaumeb/.npm/_logs/2024-08-09T14_09_47_027Z-debug-0.log
@guillaumebrunerie guillaumebrunerie added the bug Something isn't working label Aug 9, 2024
@webpro
Copy link
Collaborator

webpro commented Aug 14, 2024

Thanks for the report. Would you like to send a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants