Skip to content

Commit 7831443

Browse files
committed
add powershell env setting
1 parent 6694b51 commit 7831443

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,12 @@ npm install --global --production windows-build-tools
173173

174174
The above command installs Python 2.7 in `%USERPROFILE%\.windows-build-tools\python27` and other VS libraries. Everything should be set and should not cause any conflict with the previously-installed Python environment.
175175

176+
Also download VC 2010 runtime from [here](https://www.microsoft.com/en-us/download/details.aspx?id=14632) due to a [bug](https://github.com/JustinTulloss/zeromq.node/issues/582).
177+
176178
Then set the `npm` [for Electron](https://github.com/electron/electron/blob/master/docs/tutorial/using-native-node-modules.md), and install the required libraries.
177179

180+
On Linux / OS X:
181+
178182
```bash
179183
# env
180184
export npm_config_target=1.4.15 # electron version
@@ -189,6 +193,30 @@ npm config ls
189193
rm -rf ~/.node-gyp
190194
rm -rf ~/.electron-gyp
191195
rm -rf ./node_modules
196+
```
197+
198+
On Windows PowerShell, set environement variables in [different way](http://stackoverflow.com/questions/714877/setting-windows-powershell-path-variable):
199+
200+
```powershell
201+
$env:npm_config_target="1.4.15" # electron version
202+
$env:npm_config_arch="x64"
203+
$env:npm_config_target_arch="x64"
204+
$env:npm_config_disturl="https://atom.io/download/electron"
205+
$env:npm_config_runtime="electron"
206+
$env:npm_config_build_from_source="true"
207+
npm config ls
208+
209+
# clean caches, very important!!!!!
210+
Remove-Item "$($env:USERPROFILE)\.node-gyp" -Force -Recurse -ErrorAction Ignore
211+
Remove-Item "$($env:USERPROFILE)\.electron-gyp" -Force -Recurse -ErrorAction Ignore
212+
Remove-Item .\node_modules -Force -Recurse -ErrorAction Ignore
213+
```
214+
215+
Then install things:
216+
217+
```bash
218+
# in the same shell as above!!!
219+
# because you want to make good use of the above environment variables
192220

193221
# install everything based on the package.json
194222
npm install

0 commit comments

Comments
 (0)