node.js - 我怎样才能修复错误反应脚本启动。导入 ml5 后 react npm start 出现此错误
问题描述
我的项目包括 p5.js 运行良好,我安装了 ml5 并且我的项目运行良好,然后当我在组件中导入 ml5.js 时,出现以下错误。我该如何解决这个错误?
npm ERR! e-posture@0.1.0 start: `react-scripts start`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the e-posture@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\alishahi\AppData\Roaming\npm-cache\_logs\2020-01-26T07_54_07_158Z-debug.log
我搜索并发现我的 react-scripts 版本可能不兼容,但我不知道如何修复它。这是我的 package.json 文件:
{
"name": "e-posture",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.8.3",
"@material-ui/icons": "^4.5.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^7.2.1",
"bootstrap": "^4.4.1",
"ml5": "^0.4.3",
"node-sass": "^4.13.1",
"p5": "^0.10.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
解决方案
我通过两个步骤解决了这个问题:1)删除 ml5@0.4.3 并安装 ml5@0.3.1 2)在这些组件中的 p5 之前导入 ml5 !!!
推荐阅读
- java - 避免在我的课堂上使用扩展和实现
- android - Imageview旋转动画不会在点击时重复
- java - 场景生成器上的雷达图
- php - 如果在 WooCommerce 中为空,则在订单编辑页面(后端)上隐藏自定义字段标签
- laravel - Laravel:如何在同一 div 中显示多个上传图像或视频,如 facebook
- javascript - React 中带有 jsx 扩展的 PascalCase 或没有它的 camelCase?
- math - 定义给定体积的多维对象
- javascript - SyntaxError: missing ) 在参数列表(第 28 行,文件“Code.gs”)之后
- c++ - 模板中的(*)是什么意思
使用 L = T(*)(T);? - html - 有没有办法对列表服务器端进行分页?