我在使用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 [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN cannot run in wd [email protected] 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 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;
});
});
我希望这有帮助