buffer.js mup deploy的节点错误 - 如何撤消`sudo ln -sf / usr / local / n / versions / node / <version> / bin / node / usr / bin / node`

时间:2016-05-04 16:22:50

标签: node.js meteor deployment buffer

我在使用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命令?我应该完全卸载并重新安装节点吗?

2 个答案:

答案 0 :(得分:1)

我已安装Node v8.10.0在我的

中的以下文件中进行了一处更改
  

node_modules \ node_modules \归档\ 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;
    });
});

我希望这会有所帮助

答案 1 :(得分:0)

我似乎通过安装节点4.4.3而不是6.0.0来修复此问题github.com/Azure/azure-xplat-cli/issues/2825