流星 mup 部署期间的节点错误消息

node error message during meteor mup deploy

我在 meteor mup deploy 期间收到许多 node 错误消息。

当我 运行 mup deploy from my Github Action` 我收到以下错误消息-

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.

我的meteor node -vv12.22.1

我的 meteor npm -v6.14.12

有人知道如何解决这个问题吗??

您在 github 动作运行器上使用的是旧 node.js 版本:

    node-pre-gyp ERR! node -v v4.8.7

此版本不适用于任何最新的 meteor 版本。确保在运行器上安装节点 12(理想情况下与您的 meteor node 完全相同的版本)。但是考虑到您已经发布了多少关于此设置的问题(运行 流星出现在 github 操作上),我 强烈 推荐 运行 在你的开发机器上流星起来。这就是它的目的。

或者,我在 运行 官方 meteor build 的 github 操作中获得了很好的体验,上传生成的工件,将其下载到生产实例,在那里解压它 运行 那里包含的 README.me 文件中描述的设置步骤。

我假设您使用的是旧图像来构建您的应用程序。

查看 MUP 的可用图像:http://meteor-up.com/docs.html#meteor-support

实际上我正在使用 zodern/meteor:root 图片。