私は反応のチュートリアルに従います。最後のステップはノードを起動することですが、 "npm start" このチュートリアル。私はこのエラーが発生します。
ここでは、エラーのcmd行が開始ノード "npm start"
C:UsersGeorgeDesktopreactapp>npm start
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\nodejs\node.exe" "C:\nodejs\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! file C:UsersGeorgeDesktopreactapppackage.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token """ at 11:3
npm ERR! "keywords": [
npm ERR! ^
npm ERR! File: C:UsersGeorgeDesktopreactapppackage.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! C:UsersGeorgeDesktopreactappnpm-debug.log
最後に私のpackage.jsonファイル
{
"name": "reactapp",
"version": "1.0.0",
"description": "test react application",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "node server.js"
}
}
"keywords": [
"test",
"react",
"application"
],
"author": "George Louis",
"license": "ISC",
"dependencies": {
"webpack": "^3.0.0"
}
}
回答:
回答№1は0あなたの間にカンマがありません }
そして "keywoards"
また、あなたは十分な }
.
JSONは次のようになります
{
"name": "reactapp",
"version": "1.0.0",
"description": "test react application",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "node server.js"
},
"keywords": [
"test",
"react",
"application"
],
"author": "George Louis",
"license": "ISC",
"dependencies": {
"webpack": "^3.0.0"
}
}
回答№2の場合は0
トレースを読んだら、npmがあなたに答えを伝えています
npm ERR! Unexpected token """ at 11:3
npm ERR! "keywords": [
npm ERR! ^
npm ERR! File: C:UsersGeorgeDesktopreactapppackage.json
どの行(11)とどの行(3)のどのファイル(C:UsersGeorgeDesktopreactapppackage.json
)。
だから、カンマが足りない:
"start": "node server.js"
}
},
"keywords": [
"test",
"react",
"application"
],
あなたのJSONには存在しない "keywords"の前にカンマがあることに注意してください。それは無効です。