Hello, since Mailspring updated npm version I have not been able to use the version that I built locally. I.e. I can run it with “npm start” but if I build the deb package and install it I get a non-functional Mailspring installation. The electron window opens, but it immediatly launches the developement interface with this error in the log:
index.js:26 Error: Cannot find module ‘app-module-path’
Require stack:
- /usr/share/mailspring/resources/app.asar/src/app-env.js
- /usr/share/mailspring/resources/app.asar/src/secondary-window-bootstrap.js
- /usr/share/mailspring/resources/app.asar/static/index.html
at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
at Function.o._resolveFilename (node:electron/js2c/renderer_init:33:1095)
at Module._load (node:internal/modules/cjs/loader:785:27)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Function.o._load (node:electron/js2c/renderer_init:33:356)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:102:18)
at new AppEnvConstructor (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64/resources/app/src/app-env.ts:65:5)
at Object. (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64/resources/app/src/secondary-window-bootstrap.ts:30:17)
at Object. (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64/resources/app/src/secondary-window-bootstrap.ts:38:49)
at Module._compile (node:internal/modules/cjs/loader:1116:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1169:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:829:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Function.o._load (node:electron/js2c/renderer_init:33:356)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:102:18)
at setupWindow (file:///usr/share/mailspring/resources/app.asar/static/index.js:46:3)
at window.onload (file:///usr/share/mailspring/resources/app.asar/static/index.js:74:5)
It is probably me doing something wrong, but I am totally noob with electron, maybe someone can help me.
Some more detail: the version of npm that comes with Ubutu 20.04 is too old to run Mailspring 10.2.x:
/usr/bin/node --version
v10.19.0
For this reason, I installed a local node with nvm:
which node
/home/paulatto/.nvm/versions/node/v14.19.1/bin/node
I also install the required dependencies of Mailspring with “npm install”.
Maybe it is just a matter of selecting the correct version of node to use, but it is not documented anywhere? I also get a little warning when I run “npm install”:
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I’ll try to do my best with it!