Material UI V1-beta Create-React App

时间:2017-10-02 09:55:39

标签: javascript npm material-ui create-react-app

Ich habe soeben das从Material-UI.com installiert创建React App示例。

curl https://codeload.github.com/callemall/material-ui/tar.gz/v1-beta | tar -xz --strip=2 material-ui-1-beta/examples/create-react-app

我收到此错误消息:

npm WARN react-popper@0.7.3 requires a peer of react@0.14.x || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-popper@0.7.3 requires a peer of react-dom@0.14.x || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-scrollbar-size@2.0.1 requires a peer of react@^15.5.0 but none is installed. You must install peer dependencies yourself.

这是来自package.json的和平

"dependencies": {
    "jss": "latest",
    "jss-preset-default": "latest",
    "material-ui": "next",
    "material-ui-icons": "latest",
    "prop-types": "latest",
    "react": "latest",
    "react-dom": "latest",
    "react-jss": "latest",
    "react-scripts": "latest",
    "recompose": "latest",
    "typeface-roboto": "latest"
  },

如何正确安装对等依赖项?

运行npm start后,我收到10条错误消息:

Warning: Failed prop type: Invalid prop `jss` of type `Jss` supplied to `JssProvider`, expected instance of `Jss`.
    in JssProvider (at withRoot.js:41)
    in withRoot(withStyles(Index)) (at index.js:8)
__stack_frame_overlay_proxy_console__ @ proxyConsole.js:54

2 个答案:

答案 0 :(得分:0)

  1. 删除package.json中的jss内容。
  2. 降级至React 15.62并反应15.6.2
  3. import numpy as np import cv2 img = cv2.imread('1.jpg') gray = cv2.imread('1.jpg',0) ret,thresh = cv2.threshold(gray,127,255,1) contours,h = cv2.findContours(thresh,cv2.RETR_CCOMP,cv2.CHAIN_APPROX_NONE) for cnt in contours: approx = cv2.approxPolyDP(cnt, .03 * cv2.arcLength(cnt, True), True) print len(approx) if len(approx)==3: print "triangle" cv2.drawContours(img,[cnt],0,(122,212,78),-1) elif len(approx)==4: print "square" cv2.drawContours(img,[cnt],0,(94,234,255),-1) elif len(approx)==8: area = cv2.contourArea(cnt) (cx, cy), radius = cv2.minEnclosingCircle(cnt) circleArea = radius * radius * np.pi print circleArea print area if circleArea == area: cv2.drawContours(img, [cnt], 0, (220, 152, 91), -1) cv2.imshow('img',img) cv2.waitKey(0) cv2.destroyAllWindows()

答案 1 :(得分:0)

添加到@joerg,不要忘记删除node_modules和package-lock.json以完全删除JSS