As I've seen this a few times, I wanted to write a doc and put some of the multiple small pieces of information scattered around about this in one place.
If you are running Windows Server 2012 and you do not have .Net 3.5.1 installed, NPM will not install. There are a few ways to install the .Net infrastructure. These are:
1. DISM, whether using local source files or remote (online)
3. Windows Add Roles and Features.
There are also a few things that can get in your way.
1. Local Group policy set to use WSUS rather than Windows update.
2. UAC enabled.
3. No access to source files.
4. Security updates KB2966826, KB2966827 and KB2966828 are installed. Microsoft fix it tool NDPFixit-KB3005628 will do this.
Here are some things to check to make this a small issue rather than a painful one.
1. Uninstall KB2966826, KB2966827 and KB2966828 security updates using Microsoft's Fix it tool NDPFixit-KB3005628.
2. Disable UAC
3. Make sure the local policy points to Windows Update versus WSUS.
- Start the Local Group Policy Editor or Group Policy Management Console.
- Expand Computer Configuration, expand Administrative Templates, and then select System.
- Open the
Specify settings for optional component installation and component repairGroup Policy setting, and then select Enabled.
- Select the
Contact Windows Update directly to download repair contentinstead of
Windows Server Update Services (WSUS)check box.
4. You should now be able to run the following command and install .Net 3.5.1 from an online source.
Command (as admin prompt): dism.exe /online /enable-feature /featurename:NetFX3 /all