Skip to content

Commit bcae318

Browse files
authored
Rebuild native dependencies (Automattic#488)
* Add make target `rebuild-deps` to rebuild native dependencies * Update docs for `rebuild-deps` * Use rebuild-deps target
1 parent c24cc1d commit bcae318

4 files changed

Lines changed: 453 additions & 102 deletions

File tree

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ build-source: checks desktop$/config.json build-calypso build-desktop
3838
@echo "$(CYAN)$(CHECKMARK) All parts built$(RESET)"
3939

4040
# Start app
41-
start:
41+
start: rebuild-deps
4242
@echo "$(CYAN)Starting app...$(RESET)"
4343

4444
@NODE_ENV=$(NODE_ENV) DEBUG=$(DEBUG) npx electron .
@@ -144,12 +144,16 @@ else
144144
@echo $(GREEN)$(CHECKMARK) Current NodeJS version is on par with Calypso \($(CALYPSO_NODE_VERSION)\) $(RESET)
145145
endif
146146

147+
.PHONY: rebuild-deps
148+
rebuild-deps:
149+
@npx electron-rebuild
150+
147151
test: CONFIG_ENV = test
148-
test:
152+
test: rebuild-deps
149153
@echo "$(CYAN)Building test...$(RESET)"
150154

151155
@$(MAKE) desktop$/config.json CONFIG_ENV=$(CONFIG_ENV)
152-
@npx electron-builder install-app-deps
156+
153157
@NODE_PATH=calypso$/server$(ENV_PATH_SEP)calypso$/client npx webpack --config .$/webpack.config.test.js
154158
@CALYPSO_PATH=`pwd` npx electron-mocha --inline-diffs --timeout 15000 .$/build$/desktop-test.js
155159

docs/development.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ Starting the app
3535
make dev
3636
```
3737

38+
**🚨 Note:**
39+
In some cases you'll see an error in the apps console that is similar to this:
40+
```console
41+
[...]/spellchecker/build/Release/spellchecker.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 48. This version of Node.js requires NODE_MODULE_VERSION 54. [...]
42+
```
43+
In this case, you need to rebuild the native dependencies by running:
44+
```bash
45+
make rebuild-deps
46+
```
47+
After successfully running the command, you can start the app with `make dev`.
48+
3849
#### Skipping the calypso server
3950

4051

0 commit comments

Comments
 (0)