Babel投掷无法读取null错误的属性“绑定”

时间:2018-07-01 11:44:07

标签: javascript reactjs meteor babel

我们最近将Meteor + React应用程序升级为使用Meteor 1.7。以前是Meteor 1.6。我们正在使用Babel进行转译。如迁移文档所建议,我们已将Babel升级到7。对于Babel 7,建议我们使用babel-preset-env代替babel-preset-es2015。由于我们进行了所有这些更改,因此在执行meteor run时遇到以下错误。

使用ecmascript处理文件时(对于目标web.browser):

 C:\Users\kashif.nazar\AppData\Local\.meteor\packages\ecmascript\0.11.1\plugin.compile-ecmascript.os\npm\node_modules\meteor\babel-compiler\node_modules\@babel\traverse\lib\scope\index.js:869:13:
   Cannot read property 'bindings' of null

请注意,meteor npm install运行正常。

package.json文件中的依赖项如下。

{
  "dependencies": {
    "@babel/runtime": "^7.0.0-beta.51",
    "accounting": "^0.4.1",
    "axios": "^0.15.3",
    "babyparse": "^0.4.6",
    "bluebird": "^3.4.6",
    "bootstrap": "^3.3.7",
    "bufferutil": "^3.0.0",
    "co": "^4.6.0",
    "date-math": "0.0.1",
    "dotenv": "^4.0.0",
    "echarts": "^3.4.0",
    "echarts-for-react": "^1.1.6",
    "exceljs": "^0.5.0",
    "extract-params": "^3.0.2",
    "fibers": "^1.0.15",
    "glamor": "^2.20.40",
    "halogen": "^0.2.0",
    "immutable": "^3.8.1",
    "indexof": "0.0.1",
    "isemail": "^2.2.1",
    "joi": "^10.6.0",
    "joi-date-extensions": "^1.0.2",
    "joi-to-json-schema": "^3.0.0",
    "jquery": "^3.1.0",
    "jquery-mapael": "^2.0.0",
    "js-base64": "^2.1.9",
    "jsonfile": "^4.0.0",
    "jsonpointer": "^4.0.1",
    "jsonwebtoken": "~8.2.1",
    "jszip": "^3.1.5",
    "lodash": "^4.17.4",
    "material-ui": "^0.16.6",
    "material-ui-datatables": "^0.18.2",
    "material-ui-search-bar": "^0.4.1",
    "materialize-css": "^0.97.8",
    "materialui-pagination": "0.0.6",
    "md5": "^2.1.0",
    "meteor-node-stubs": "^0.2.3",
    "mgr-pdf-viewer-react": "^1.0.0",
    "mock-socket": "^7.1.0",
    "moment": "^2.17.1",
    "node-ensure": "0.0.0",
    "node-uuid": "^1.4.7",
    "npm": "^5.6.0",
    "rc-collapse": "^1.7.0",
    "rc-slider": "^7.0.6",
    "rc-tooltip": "^3.4.3",
    "react": "^15.4.2",
    "react-addons-css-transition-group": "^15.3.1",
    "react-addons-pure-render-mixin": "^15.2.0",
    "react-bootstrap": "^0.30.5",
    "react-breadcrumbs": "^1.5.1",
    "react-dom": "^15.4.1",
    "react-dropzone": "^3.13.3",
    "react-icons": "^2.2.7",
    "react-jsonschema-form": "^1.0.0",
    "react-komposer": "^1.13.1",
    "react-masonry-component": "^4.2.2",
    "react-material-icons": "^1.0.2",
    "react-player": "^0.25.3",
    "react-prism": "^4.3.2",
    "react-pure-render": "^1.0.2",
    "react-redux": "^4.4.5",
    "react-router": "^3.0.0",
    "react-router-redux": "^4.0.5",
    "react-slick": "^0.14.5",
    "react-stepper-horizontal": "^1.0.9",
    "react-sticky": "^5.0.5",
    "react-tap-event-plugin": "^2.0.1",
    "reactstrap": "^4.8.0",
    "redux": "^3.5.2",
    "redux-form": "^7.0.1",
    "redux-form-material-ui": "^4.1.2",
    "redux-logger": "^2.6.1",
    "redux-logic": "^0.11.6",
    "redux-promise": "^0.5.3",
    "redux-thunk": "^2.1.0",
    "reselect": "^2.5.4",
    "rxjs": "^5.1.1",
    "setimmediate": "^1.0.5",
    "shortid": "^2.2.6",
    "slick-carousel": "^1.6.0",
    "socket.io": "^2.0.4",
    "socket.io-client": "^2.0.4",
    "socketio-wildcard": "^2.0.0",
    "strong-data-uri": "^1.0.4",
    "swagger-client": "^2.1.30",
    "traverse": "^0.6.6",
    "underscore": "^1.8.3",
    "url-pattern": "^1.0.3",
    "utf-8-validate": "^3.0.1",
    "uuid": "^2.0.3",
    "valid-url": "^1.0.9",
    "video-react": "^0.9.3",
    "voca": "^1.3.0",
    "xlsx": "^0.10.8",
    "xml2js": "^0.4.17"
  },
  "devDependencies": {
    "babel-preset-env": "~1.7.0",
    "babel-preset-react": "^6.16.0",
    "chai": "^3.5.0",
    "chai-as-promised": "^6.0.0",
    "chai-enzyme": "^0.6.1",
    "enzyme": "^2.6.0",
    "eslint": "^3.16.1",
    "fs-extra": "^3.0.1",
    "jsdom": "^9.8.3",
    "jsdom-global": "^2.1.0",
    "matchmedia-polyfill": "^0.3.0",
    "mocha": "^3.2.0",
    "mocha-plugin-co": "^1.0.0",
    "moxios": "^0.4.0",
    "proxyquire": "^1.7.11",
    "react-addons-test-utils": "^15.4.2",
    "redux-devtools": "^3.3.1",
    "redux-devtools-dock-monitor": "^1.1.1",
    "redux-devtools-log-monitor": "^1.0.11",
    "redux-mock-store": "^1.2.0",
    "redux-test-utils": "^0.2.2",
    "sinon": "^1.17.6",
    "sinon-chai": "^2.10.0"
  }
}

.babelsrc具有以下几行。

{
  "presets": ["env"]
}

配置中是否缺少导致错误的内容?

0 个答案:

没有答案