Material-ui - 无法解析模块&f; fbjs / lib / emptyFunction',' fbjs / lib / invariant',' fbjs / lib / warning'

时间:2017-05-19 05:21:03

标签: material-ui

我正在尝试将material-ui用于项目。使用它时会抛出以下错误:

enter image description here

我试过通过github存储库来解决类似的问题而没有任何运气。任何人都有任何想法可能是什么问题?我正在添加package.json文件,以防它的任何依赖性搞砸了。

的package.json

{
  "name": "bidding",
  "version": "1.0.0",
  "description": "Testing bidding application",
  "scripts": {
    "prestart": "babel-node tools/startMessage.js",
    "start": "npm-run-all --parallel test:watch open:src lint:watch",
    "open:src": "babel-node tools/srcServer.js",
    "lint": "node_modules/.bin/esw webpack.config.* src tools",
    "lint:watch": "npm run lint -- --watch",
    "test": "mocha --reporter progress tools/testSetup.js \"src/**/*.test.js\"",
    "test:watch": "npm run test -- --watch",
    "clean-dist": "npm run remove-dist && mkdir dist",
    "remove-dist": "node_modules/.bin/rimraf ./dist",
    "build:html": "babel-node tools/buildHtml.js",
    "prebuild": "npm-run-all clean-dist test build:html",
    "build": "babel-node tools/build.js",
    "postbuild": "babel-node tools/distServer.js"
  },
  "author": "Supreet Singh",
  "license": "open",
  "dependencies": {
    "babel-polyfill": "6.8.0",
    "bootstrap": "3.3.7",
    "hashids": "^1.1.1",
    "j-i-c": "^2.0.2",
    "jquery": "2.2.3",
    "js-cookie": "^2.1.4",
    "material-ui": "^0.18.1",
    "nprogress": "^0.2.0",
    "react": "15.4.2",
    "react-bootstrap": "^0.30.8",
    "react-dom": "15.4.2",
    "react-dropzone": "^3.12.2",
    "react-redux": "4.4.5",
    "react-router": "2.4.0",
    "react-router-redux": "4.0.4",
    "react-tap-event-plugin": "^2.0.0",
    "redux": "3.5.2",
    "redux-devtools-extension": "^2.13.0",
    "redux-localstorage": "0.4.1",
    "redux-thunk": "^2.0.1",
    "tether": "1.3.7",
    "toastr": "2.1.2",
    "uuid-js": "^0.7.5"
  },
  "devDependencies": {
    "babel-cli": "6.8.0",
    "babel-core": "6.8.0",
    "babel-loader": "6.2.4",
    "babel-plugin-react-display-name": "2.0.0",
    "babel-preset-es2015": "6.6.0",
    "babel-preset-react": "6.5.0",
    "babel-preset-react-hmre": "1.1.1",
    "babel-register": "6.8.0",
    "cheerio": "0.22.0",
    "colors": "1.1.2",
    "compression": "1.6.1",
    "cross-env": "1.0.7",
    "css-loader": "0.23.1",
    "enzyme": "2.2.0",
    "eslint": "2.9.0",
    "eslint-plugin-import": "1.6.1",
    "eslint-plugin-react": "5.0.1",
    "eslint-watch": "2.1.11",
    "eventsource-polyfill": "0.9.6",
    "expect": "1.19.0",
    "express": "4.13.4",
    "extract-text-webpack-plugin": "1.0.1",
    "file-loader": "0.8.5",
    "jsdom": "8.5.0",
    "mocha": "2.4.5",
    "nock": "8.0.0",
    "npm-run-all": "1.8.0",
    "open": "0.0.5",
    "react-addons-test-utils": "15.0.2",
    "redux-immutable-state-invariant": "1.2.3",
    "redux-mock-store": "1.0.2",
    "rimraf": "2.5.2",
    "style-loader": "0.13.1",
    "url-loader": "0.5.7",
    "webpack": "1.13.0",
    "webpack-dev-middleware": "1.6.1",
    "webpack-hot-middleware": "2.10.0"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/supreetsingh247/bidding"
  }
}

1 个答案:

答案 0 :(得分:3)

npm install --save fbjs为我工作(material-ui==0.18.1)。

看起来他们错过了依赖(在master中似乎是removed)。希望下次更新material-ui时,我们将能够删除对fbjs的明确依赖,并继续前进。