我已经使用“create-react-app”创建了一个React应用程序,并且它通过“npm start”运行良好,但是,当我尝试构建或部署到Heroku时,我从react-scripts build.js中收到一个错误,日志如下:
-----> Build
Running build
> areaos-react@0.1.0 build /tmp/build_b6b622a1f46daa3af2d16fdb6ffb259a
> react-scripts build
Creating an optimized production build...
Failed to compile.
Parse error on line 1:
0.3(-1)
---^
Expecting end of input, "ADD", "SUB", "MUL", "DIV", got unexpected "LPAREN"
Run Code Online (Sandbox Code Playgroud)
我尝试过: -更新npm模块,包括react-scripts -从package.json中删除“react-scripts build” -将package.json中的“main”更改为“react-scripts start”
这是我的 package.json
{
"name": "doggos-react",
"version": "0.1.0",
"engines": {
"node": "8.9.3",
"npm": "6.9.0"
},
"private": true,
"dependencies": {
"caniuse-lite": "^1.0.30000989",
"chart.js": "^2.8.0",
"chartjs-plugin-labels": "^1.1.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"gl-react": "^3.17.2",
"glsl-fxaa": "^3.0.0",
"glslify": "^7.0.0", …Run Code Online (Sandbox Code Playgroud)