I experienced this same issue when installing Node version manager (NVM) on Windows 10.
Whenever I run the command:
npm install -g yarn
I was getting the error below:
Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
The issue was that there other components of the previous Node installations that were interfering with the Node version manager (NVM) setup.
Here's how I fixed it:
All I had to do was to go to the Control Panel of the Windows machine.
Uninstalled Node version manager (NVM) for windows. This removed every other component and directory of the previous Node installations.
Next, I did a new installation of the Node version manager (NVM)
This time when I ran the command below everything worked fine:
npm install -g yarn
That's all.
I hope this helps