Skip to content
/ node Public
forked from nodejs/node

Commit e431cae

Browse files
Steven Rockartspiscisaureus
Steven Rockarts
authored andcommitted
win,msi: create npm folder in AppData directory
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. Bug: nodejs/node-v0.x-archive#8141 PR: nodejs/node-v0.x-archive#8838 Reviewed-by: Bert Belder <[email protected]> Please enter the commit message for your changes. Lines starting
1 parent 42ebdcb commit e431cae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/msvs/msi/product.wxs

+12
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<ComponentRef Id="NodeExecutable"/>
4747
<ComponentRef Id="NodeVarsScript"/>
4848
<ComponentRef Id="NodeStartMenuAndRegistryEntries"/>
49+
<ComponentRef Id="AppData" />
4950
<ComponentGroupRef Id="Product.Generated"/>
5051

5152
<Feature Id="NodePerfCtrSupport"
@@ -70,6 +71,7 @@
7071
<ComponentRef Id="NpmCmdScript"/>
7172
<ComponentRef Id="NpmBashScript"/>
7273
<ComponentRef Id="NpmConfigurationFile"/>
74+
<ComponentRef Id="AppData" />
7375
<ComponentGroupRef Id="NpmSourceFiles"/>
7476
</Feature>
7577

@@ -184,6 +186,16 @@
184186
</Component>
185187
</Directory>
186188
</Directory>
189+
190+
<Directory Id="AppDataFolder">
191+
<Directory Id="AppDataDir" Name="npm">
192+
<Component Id="AppData" Guid="D3B35D0E-D0F9-4D11-A773-D4608E90E1D1">
193+
<CreateFolder />
194+
<RemoveFolder Id="AppDataDir" On="uninstall" />
195+
<RegistryValue Root="HKCU" Key="$(var.RegistryKeyPath)\Components" Type="string" Value="" />
196+
</Component>
197+
</Directory>
198+
</Directory>
187199
</DirectoryRef>
188200

189201
<DirectoryRef Id="ApplicationProgramsFolder">

0 commit comments

Comments
 (0)