'npm install always installing in the same directory and not to current directory

I am facing really a weird issue.

when i try to run the command 'npm install' it always installs in a different directory.

eg: i have the package.json in C:\Folder1\ and when i try to run 'npm install' it installs in C:\Folder2\

I tried running the command

'npm config list'

it always shows the 'cwd: C:\Folder2\' as the current working directory

How can i change the cwd path so it works wherever the package.json exists.

Same code work for other developers correctly. this behavior is only happending in one of the machine

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source