错误防止捆绑:处理带有ecmascript的文件时(对于目标web.browser):

时间:2018-09-23 14:14:48

标签: node.js meteor npm build babel

我试图运行命令meteor build --directory .来为流星应用程序建立一个捆绑目录,然后出现如下错误: Errors prevented bundling:
While processing files with ecmascript (for target web.browser): /home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/ @babel/core/lib/config/validation/option-assertions.js:146:13: [BABEL] bundle/programs/web.browser/app/scripts/vendor/modernizr.js: .plugins[0] may only be a two-tuple or three-tuple at assertPluginItem (/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules /@babel/core/lib/config/validation/option-assertions.js:146:13) at /home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/ @babel/core/lib/config/validation/option-assertions.js:132:14 at Array.forEach (<anonymous>) at assertPluginList (/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules /@babel/core/lib/config/validation/option-assertions.js:131:9) at /home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/ @babel/core/lib/config/validation/options.js:83:20 at Array.forEach (<anonymous>) at validate (/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules /@babel/core/lib/config/validation/options.js:61:21) at /home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/ @babel/core/lib/config/index.js:246:36 at cachedFunction (/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules /@babel/core/lib/config/caching.js:40:17) at loadPresetDescriptor
...以及更多类似的行。我研究了stackoverflow和github上的一些问题,发现了诸如meteor npm install --save babel-runtime之类的一些命令,并尝试了它们,但仍然出现相同的错误。如果有人可以帮助,那就太好了。

这是.babelrc文件:

```
{
  "presets": [
  ],
  "plugins": [
    [
      "transform-class-properties",
      "babel-plugin-inline-import",
      "babel-plugin-inline-import-graphql-ast",
      {
        "extensions": [
          ".graphqls",
          ".graphql"
        ]
      }
    ]
  ]
}```

这是package.json文件:

```{
  "name": "enliven-frontend",
  "version": "1.8.9",
  "engines": {
    "npm": "^3.0"
  },
  "scripts": {
    "prestart": "sh prestart_vulcan.sh",
    "start": "meteor --settings settings-development.json",
    "start-the-show": "meteor --settings settings-production.json",
    "lint": "eslint --cache --ext .jsx,js packages"
  },
  "dependencies": {
    "@babel/runtime": "^7.0.0-beta.55",
    "analytics-node": "^2.4.1",
    "apollo-client": "^1.9.1",
    "apollo-engine": "^0.5.4",
    "apollo-errors": "^1.4.0",
    "apollo-server-express": "^1.3.2",
    "bcrypt": "^1.0.3",
    "body-parser": "^1.18.2",
    "chalk": "2.2.0",
    "classnames": "^2.2.5",
    "cloudflare": "^2.4.1",
    "compression": "^1.7.1",
    "cookie-parser": "^1.4.3",
    "cross-fetch": "^0.0.8",
    "crypto-js": "^3.1.9-1",
    "dataloader": "^1.3.0",
    "deepmerge": "^1.5.0",
    "escape-string-regexp": "^1.0.5",
    "express": "^4.15.4",
    "flat": "^4.0.0",
    "formsy-react": "^0.19.5",
    "formsy-react-components": "^0.11.1",
    "graphql": "^0.10.5",
    "graphql-anywhere": "^3.0.1",
    "graphql-date": "^1.0.2",
    "graphql-tag": "^2.0.0",
    "graphql-tools": "^2.19.0",
    "graphql-type-json": "^0.1.4",
    "handlebars": "^4.0.10",
    "he": "^1.1.1",
    "history": "^3.3.0",
    "html-to-text": "^2.1.3",
    "immutability-helper": "^2.3.1",
    "import": "0.0.6",
    "install": "^0.10.1",
    "intl": "^1.2.5",
    "intl-locales-supported": "^1.0.0",
    "isomorphic-fetch": "^2.2.1",
    "json-path": "^0.1.3",
    "juice": "^1.11.0",
    "lodash": "^4.17.5",
    "mailchimp": "^1.2.0",
    "marked": "^0.3.9",
    "metascraper": "^1.0.7",
    "meteor-node-stubs": "^0.3.2",
    "mingo": "^0.8.1",
    "moment": "^2.18.1",
    "new-relic-agent-react": "^2.0.1",
    "optics-agent": "^1.1.6",
    "photoswipe": "^4.1.2",
    "prop-types": "^15.5.10",
    "rangy": "^1.3.0",
    "react": "^16.2.0",
    "react-addons-pure-render-mixin": "^15.6.0",
    "react-apollo": "^1.4.15",
    "react-bootstrap": "^0.32.0",
    "react-bootstrap-datetimepicker": "0.0.22",
    "react-cookie": "^0.4.9",
    "react-country-region-selector": "^1.1.0",
    "react-datetime": "^2.11.1",
    "react-dfp": "^0.7.5",
    "react-dom": "^16.2.0",
    "react-dropzone": "^3.13.4",
    "react-flexview": "^1.0.13",
    "react-headroom": "^2.2.1",
    "react-helmet": "^5.2.0",
    "react-image-smooth-loading": "^2.0.0",
    "react-intl": "^2.3.0",
    "react-lazyload": "^2.3.0",
    "react-load-script": "0.0.6",
    "react-loadable": "^4.0.4",
    "react-masonry-component": "^5.0.7",
    "react-places-autocomplete": "^5.4.2",
    "react-progressive-image-loading": "^3.0.2",
    "react-redux": "^5.0.6",
    "react-router": "^3.2.0",
    "react-router-bootstrap": "^0.23.3",
    "react-router-scroll": "^0.4.4",
    "react-sidebar": "^2.3.2",
    "react-stripe-checkout": "^2.4.0",
    "react-swipeable": "^4.3.0",
    "recompose": "^0.26.0",
    "redux": "^3.7.2",
    "rss": "^1.2.2",
    "sanitize-html": "^1.16.3",
    "sendy-api": "^0.1.0",
    "simpl-schema": "^0.2.3",
    "sitemap": "^1.13.0",
    "speakingurl": "^9.0.0",
    "stripe": "^4.24.0",
    "styled-components": "^2.1.2",
    "tracker-component": "^1.3.21",
    "twit": "^2.2.9",
    "underscore": "^1.8.3",
    "url": "^0.11.0"
  },
 `` "private": true,
  "devDependencies": {
    "autoprefixer": "^7.1.2",
    "babel-eslint": "^7.0.0",
    "babel-plugin-inline-import": "^2.0.6",
    "babel-plugin-inline-import-graphql-ast": "^2.0.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-env": "^1.6.0",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-3": "^6.24.1",
    "compass-sass-mixins": "^0.12.7",
    "eslint": "^3.10.1",
    "eslint-config-airbnb": "^13.0.0",
    "eslint-config-meteor": "0.0.9",
    "eslint-import-resolver-meteor": "^0.3.3",
    "eslint-plugin-babel": "^3.3.0",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-jsx-a11y": "^2.2.3",
    "eslint-plugin-meteor": "^4.0.1",
    "eslint-plugin-prettier": "^2.5.0",
    "eslint-plugin-react": "^6.7.1"
  },
  "postcss": {
    "plugins": {
      "postcss-easy-import": {
        "extensions": [
          ".css",
          ".scss",
          ".import.css"
        ],
        "prefix": "_"
      },
      "postcss-simple-vars": {},
      "postcss-sassy-mixins": {},
      "postcss-nested": {},
      "autoprefixer": {
        "browsers": [
          "last 2 versions"
        ]
      }
    },
    "parser": "postcss-scss"
  },
  "cssModules": {
    "ignorePaths": [
      "node_modules",
      "bower_components"
    ]
  },
  "description": "## Requirements",
  "main": "mobile-config.js",
  "repository": {
  "type": "git",
    "url": "git+ssh://git@gitlab.com/enliven/enliven-frontend.git"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://gitlab.com/enliven/enliven-frontend/issues"
  },
  "homepage": "https://gitlab.com/enliven/enliven-frontend#README"
}```

1 个答案:

答案 0 :(得分:0)

我认为您无法在中创建捆绑包。文件夹。

您应将用于存储捆绑文件的文件夹传递给该文件夹,该文件夹必须不同。我建议您创建一个.bundle文件夹,并将其传递给bundle命令。点很重要,因为流星会忽略以点开头的文件夹和文件