node.jswindowsnpmnpm-installhusky

npm install Error: The system cannot find the path specified


I've been trying to run npm install on one of the projects on my Windows machine that I'm starting to work on, but I'm getting the following error:

The system cannot find the path specified.
npm error code 1
npm error path C:\Users\hugome\source\repos-github\hn-root-ui\hn-core-ui
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c husky install

The system cannot find the path specified. error command C:\WINDOWS\system32\cmd.exe /d /s /c husky install.

I've already tried some solutions I found, such as updating nodejs and npm to the versions my team asked me to use: node v: 22.14.0 & npm 11.2.0: node and npm versions

I also checked the environment variables for both system and account variables and everything looks fine: (edgarde-a is the Admin account and hugome is the local account). Env variables for current account.

I also tried uninstalling and installing nodejs again (I have multiple versions and even selecting the correct version the problem still occurs).

I don't know if I'm missing something else. Even my coworkers who already have this project running have no idea what exactly is going on on my computer.

I have also tried some of the solutions for this question without any result:

https://stackoverflow.com/questions/39190164/npm-the-system-cannot-find-the-path-specified

such as deleteing the npm folder and npm-cache folder, moved my node path to the top of the system path variables or using npm config set script-shell bash.


Solution

  • Found the solution in another Question: by using npm config set script-shell powershell fixed the problem