【问题标题】:buffer.js Node error with mup deploy - how can i undo ` sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node `buffer.js 节点错误与 mup 部署 - 我如何撤消` sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node `
【发布时间】:2016-08-30 05:05:49
【问题描述】:

我在使用 mup 部署流星应用时遇到问题并收到此错误:

tarted TaskList: Deploy app 'thermaMup' (linux)
[107.170.77.189] - Uploading bundle
[107.170.77.189] - Uploading bundle: SUCCESS
[107.170.77.189] - Setting up Environment Variables
[107.170.77.189] - Setting up Environment Variables: SUCCESS
[107.170.77.189] - Invoking deployment process
[107.170.77.189] x Invoking deployment process: FAILED

    -----------------------------------STDERR-----------------------------------
    npm WARN package.json meteor-dev-bundle@0.0.0 No description
    npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
    npm WARN package.json meteor-dev-bundle@0.0.0 No README data
    npm WARN cannot run in wd meteor-dev-bundle@0.0.0 node npm-rebuild.js (wd=/opt/thermaMup/tmp/bundle/programs/server)
    stop: Unknown instance: 
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to localhost port 80: Connection refused
    App did not pick up! Please check app logs.

我的日志已读

[107.170.77.189] error: Script restart attempt #150[107.170.77.189] 
[107.170.77.189] Meteor requires Node v0.10.41 or later.[107.170.77.189] 

通过将 mup.json 文件更改为具有更长的deployCheckWaitTime 和不同的nodeVersion,我已经能够在单独的笔记本电脑上解决此问题。但是,我已经在我的桌面上运行了这些命令:

sudo npm cache clean -f
sudo npm install -g n
 sudo n stable
 sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node 

现在我在桌面上看到的错误是:

Building Started: .
buffer.js:106
      throw new Error(
      ^

Error: If encoding is specified then the first argument must be a string
    at new Buffer (buffer.js:106:13)
    at Readable.<anonymous> (/usr/local/lib/node_modules/mup/node_modules/archiver/lib/util/index.js:32:15)
    at emitNone (events.js:91:20)
    at Readable.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:926:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

我如何撤消之前的 sudo 命令?我应该完全卸载并重新安装节点吗?

【问题讨论】:

标签: node.js meteor deployment buffer


【解决方案1】:

我似乎通过安装节点 4.4.3 而不是 6.0.0 github.com/Azure/azure-xplat-cli/issues/2825 解决了这个问题

【讨论】:

    【解决方案2】:

    我已安装Node v8.10.0 在我的以下文件中进行了一项更改

    node_modules\node_modules\archiver\lib\util\index.js

    source.on('end', function() {
        //(may be different for few) Line 32: 
        // updated this line and add +'' in the first param to make it as string argument 
        var buf = new Buffer(size+'', 'utf8'); 
    
        var offset = 0;
    
        collection.forEach(function(data) {
            data.copy(buf, offset);
            offset += data.length;
        });
    });
    

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-26
      • 2019-01-15
      • 1970-01-01
      • 1970-01-01
      • 2016-02-12
      • 2020-03-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多