Skip to content

Commit

Permalink
windows: Create npm folder in AppData directory
Browse files Browse the repository at this point in the history
Create the empty npm folder in Roaming\Appdata so that
non-Administrator users have a place to store global packages.
This fixes the error Error: ENOENT, stat error that occurs
when a user tries to run the npm install <package> command.

Fixes nodejs#8141
  • Loading branch information
Steven Rockarts authored and rockarts committed Dec 10, 2014
1 parent cfcb1de commit 8f2ddde
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/msvs/msi/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<ComponentRef Id="NpmCmdScript"/>
<ComponentRef Id="NpmBashScript"/>
<ComponentRef Id="NpmConfigurationFile"/>
<ComponentRef Id="AppData" />
<ComponentGroupRef Id="NpmSourceFiles"/>
</Feature>

Expand Down Expand Up @@ -184,6 +185,16 @@
</Component>
</Directory>
</Directory>

<Directory Id="AppDataFolder">
<Directory Id="AppDataDir" Name="npm">
<Component Id="AppData" Guid="D3B35D0E-D0F9-4D11-A773-D4608E90E1D1">
<CreateFolder />
<RemoveFolder Id="AppDataDir" On="uninstall" />
<RegistryValue Root="HKCU" Key="$(var.RegistryKeyPath)\Components" Type="string" Value="" />
</Component>
</Directory>
</Directory>
</DirectoryRef>

<DirectoryRef Id="ApplicationProgramsFolder">
Expand Down

0 comments on commit 8f2ddde

Please sign in to comment.