I am receiving many node
error messages during the meteor mup deploy
.
When I run mup deploy from my
Github Action` I am receiving the following error message-
Run cd meteor-api/.deploy/staging && mup deploy
Building App Bundle Locally
discarding invalid livedata message { testMessageOnConnect: true }
Started TaskList: Pushing Meteor App
[13.xxx.xxx.xxx] - Pushing Meteor App Bundle to the Server
[13.xxx.xxx.xxx] - Pushing Meteor App Bundle to the Server: SUCCESS
[13.xxx.xxx.xxx] - Prepare Bundle
[13.xxx.xxx.xxx] x Prepare Bundle: FAILED
------------------------------------STDERR------------------------------------
The command '/bin/sh -c cd /built_app/programs/server && npm install --unsafe-perm' returned a non-zero code: 1
real 0m50.190s
user 0m1.996s
sys 0m1.394s
------------------------------------STDOUT------------------------------------
e_modules/nodemailer
> node -e "try{require('./postinstall')}catch(e){}"
nodemailer@6.4.6 /built_app/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer
stream-buffers@3.0.2 /built_app/programs/server/npm/node_modules/meteor/email/node_modules/stream-buffers
> node-libcurl@2.2.0 install /built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/JCMais/node-libcurl/releases/download/v2.2.0/node_libcurl-v2.2.0-node-v46-linux-x64-glibc.tar.gz
node-pre-gyp WARN Pre-built binaries not found for node-libcurl@2.2.0 and node@4.8.7 (node-v46 ABI, glibc) (falling back to source compile with node-gyp)
/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/env-paths/index.js:7
const {env} = process;
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-gyp/bin/node-gyp.js:7:18)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/opt/nodejs/bin/node /built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-gyp/bin/node-gyp.js clean' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:862:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)
node-pre-gyp ERR! System Linux 5.8.0-1041-aws
node-pre-gyp ERR! command "/opt/nodejs/bin/node" "/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl
node-pre-gyp ERR! node -v v4.8.7
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! not ok
Failed to execute '/opt/nodejs/bin/node /built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-gyp/bin/node-gyp.js clean' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-libcurl@2.2.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-libcurl@2.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-14T12_16_55_144Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meteor-dev-bundle@ install: `node npm-rebuild.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor-dev-bundle@ install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-14T12_16_55_168Z-debug.log
------------------------------------------------------------------------------
Error: Process completed with exit code 1.
my meteor node -v
is v12.22.1
and my meteor npm -v
is 6.14.12
Does anyone have any idea how to solve this problem??
You are using an old node.js version on your github actions runner:
node-pre-gyp ERR! node -v v4.8.7
This version won't work for any even somewhat recent meteor versions. Make sure to install node 12 on the runner (ideally the exact same version as your meteor node
). But Given how many issues you've already posted with this setup (running meteor-up on github actions), I would strongly recommend just running meteor-up on your dev machine. That's what it was intended for.
Alternatively, I've made good experiences just running the official meteor build
in a github action, uploading the resulting artifact, downloading it on a self-hosted runner on the production instance, untarring it there and running the setup steps described in the included README.me file there.