Meteor Up 部署失败但应用程序在开发中运行良好

Meteor Up deploy failed but app runs fine in development

我正在测试我的第一个 Meteor 应用程序的部署,并考虑使用 Meteor Up。经过多次摆弄之后,我设法 运行 mup setup 没有任何错误,一切似乎都很好。

但是,运行ning mup deploy 失败了:

$ mup deploy
Building App Bundle Locally
Errors prevented bundling:
While minifying app code:
eval at <anonymous>
(/home/yanick/.meteor/packages/standard-minifier-js/.1.2.1.s85ddv++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:1545:18: SyntaxError: Unexpected token: name (Converter)
at new JS_Parse_Error (eval at <anonymous>
(/home/yanick/.meteor/packages/standard-minifier-js/.1.2.1.s85ddv++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifier-js/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:1545:18) at js_error (eval at <anonymous>
...

错误的文件似乎是 Converter.js,但这个文件没什么特别的,只是导出了一些 JSON 对象:

import Converter from 'universal-converter';

export default Converter;

export const DEFAULT_UNIT = 'unit';

export const Units = {
  'unit': {
    'type': 'unit',
    'name': 'unit'
  },
  'inch': {
    'type': 'distance',
    'name': 'inch',
    'label': 'in'
  },
  'inch2': {
    'type': 'area',
    'name': 'square inch',
    'label': 'in²'
  },
  'foot': {
    'type': 'distance',
    'name': 'foot',
    'label': 'ft'
  },
  'foot2': {
    'type': 'area',
    'name': 'square foot',
    'label': 'ft²'
  },
  'yard': {
    'type': 'distance',
    'name': 'yard',
    'label': 'yd'
  },
  'yard2': {
    'type': 'area',
    'name': 'square yard',
    'label': 'yd²'
  },
  'cm': {
    'type': 'distance',
    'name': 'centimeter',
    'label': 'cm'
  },
  'm': {
    'type': 'distance',
    'name': 'meter',
    'label': 'm'
  },
  'g': {
    'type': 'mass',
    'name': 'gram',
    'label': 'g'
  },
  'kg': {
    'type': 'mass',
    'name': 'kilogram',
    'label': 'kg'
  },
  'lb' : {
    'type': 'mass',
    'name': 'pound',
    'label': 'lb'
  },
  'oz': {
    'type': 'mass',
    'name': 'once [France]',
    'label': 'oz'
  },
  'liter': {
    'type': 'volume',
    'name': 'liter',
    'label': 'L'
  },
  'gal': {
    'type': 'volume',
    'name': 'gallon [US, liquid]',
    'label': 'Gal'
  },
  'oz_v': {
    'type': 'volume',
    'name': 'ounce [UK, liquid]',
    'label': 'oz'
  }
};

为什么 meteor 运行ning 正常,但创建应用程序包失败?


更新 1

我已经尝试重构我的应用程序目录,moving the build around,没有任何变化。此命令:meteor build ../output(路径在我的项目的根文件夹之外)如上所述失败。

请看to the related issue on Github。 在这个页面,@Abernix 找到了一个临时解决方案:

在项目的根目录下,执行以下命令行:

meteor remove standard-minifier-js

meteor add abernix:standard-minifier-js@1.2.2

然后,再次尝试构建。

警告:正如@Abernix 所说:

Please don't consider this as a long-term solution (as it will be better if you remain on the official package), but more of a survey to see how their progress is is going. There is still work to be done before it's finished, but I'm curious if it fixes it for any of you. My package is using the 2.7.5 release of the uglify-js harmony branch (which is still not considered stable, but might work for some).