React Setup'npm run build'error'意外标记'b'在18:4“

目前使用本教程: http : //www.zsoltnagy.eu/step-by-step-environment-setup-of-the-react-developer-no-legacy-2016-standards/

我以为我正确地遵循了一切,但当我尝试第七步,我得到这个错误(见图片)。

这里是我的package.json文件 – 我承认我可能改变了一些东西,同时试图让我自己的工作。

{ "name": "rapp", "version": "1.0.0", "description": "\"\"", "main": "index.js", "repository": { "type": "git", "url": "\"\"" }, "keywords": [ "\"\"" ], "author": "\"BH0\"", "license": "ISC", "scripts": { "test": "\"\"" "build": "webpack -d && cp src/app/index.html dist/index.html && webpack-dev-server --hot --inline --colors --progress --content-base src/", "build-prod": "webpack -p && cp src/app/index.html dist/index.html" } 

}

谢谢。 input'npm run build'后,在Console中显示的错误屏幕截图

您应该在“testing”之后添加一个逗号:“\”\“”

你的package.json是无效的。 删除脚本部分中的testing条目或在其后添加一个。 现在它应该工作。

它应该是

 { "name": "rapp", "version": "1.0.0", "description": "\"\"", "main": "index.js", "repository": { "type": "git", "url": "\"\"" }, "keywords": [ "\"\"" ], "author": "\"BH0\"", "license": "ISC", "scripts": { "test": "\"\"", "build": "webpack -d && cp src/app/index.html dist/index.html && webpack-dev-server --hot --inline --colors --progress --content-base src/", "build-prod": "webpack -p && cp src/app/index.html dist/index.html" }