Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm ERR! Cannot read properties of undefined (reading 'stdin') when using git bash on windows

Tags:

git

npm

git-bash

When I am using Git Bash on windows, and try to do npm commands, I am getting this error:

npm ERR! Cannot read properties of undefined (reading 'stdin')

Until 2 days ago it was not a problem, and when I am using cmd or powershell it works just fine.

Tried to clone the repos again, did not work. Tried to delete node modules and package-log.json, did not work. Tried to clear cache, did not work.

Edit: I lowered Node version and it worked for now, but still interesting why it happend.

like image 526
Lior Shein Avatar asked Sep 18 '25 08:09

Lior Shein


1 Answers

In my case, it was due to the console type, specifically git bash. Changing it to powershell solved this issue for me.

like image 143
Loretta Avatar answered Sep 20 '25 22:09

Loretta