skip to Main Content

I run the command npm version patch in the integrated terminal in VS Code and it fails to run it and this is the log:

'add',
info git   'C:\Users\User\source\repos\ 
 client\src\quickapp\clientapp\package.json

'add',
info git   'C:\Users\User\source\repos\ 
 client\src\quickapp\clientapp\package-lock.json

info git [ 'commit', '-m', '1.12.9' ]

It tries to stage the files using their full path without success, and when it comes to the commit part it fails because the files are not staged.

When I run the command from the integrated terminal like this: git add package.json it works as expected but with the full path it doesn’t.

More Information:
When I run npm version patch from git bash it works fine.

What VS Code settings am I missing here?

5

Answers


  1. It might not answer your question but it should solve the issue.

    You could use git bash as vscode terminal as describe here : https://blog.danielpadua.dev/posts/git-bash-with-vscode/

    Login or Signup to reply.
  2. Perhaps vsCode does not have the right permissions?
    What happens if you run vsCode as administrator?

    Login or Signup to reply.
  3. Can you change VScode terminal to git bash like in the picture ?
    Integrated terminals can be different. if it isnt visible @bieboebap answer can add the gitbash to your integrated terminal.

    IMG

    And for npm commands you should check this question.

    Login or Signup to reply.
  4. update git to 2.37.3 currently https://git-scm.com/download/win
    git add using fullPath is supposed to work

    git --version
    git version 2.37.3.windows.1

    operating system: I assume windows because \

    Login or Signup to reply.
  5. In VSCode type ctrl+shift+p to open the user preferences and then search for features -> terminal -> cwd and if it has a value you should clear it.

    cwd is An explicit start path where the terminal will be launched, this is used as the current working directory (cwd) for the shell process. This may be particularly useful in workspace settings if the root directory is not a convenient cwd.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search