以下是我的package.json文件:「無效數字在行文字」錯誤
{
"name": "site",
"version": "1.0.0",
"description": "Website",
"main": "main.js",
"engines": {
"node": "6.11.2"
},
"scripts": {
"start": "node main_cluster.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Subaru",
"license": "UNLICENSED",
"dependencies": {
"body-parser": "^1.18.2",
"connect-pg-simple": "^4.2.1",
"cookie-parser": "^1.4.3",
"csurf": "^1.9.0",
"express": "^4.15.4",
"express-handlebars": "^3.0.0",
"express-logger": "0.0.3",
"express-session": "^1.15.5",
"formidable": "^1.1.1",
"loadtest": "^2.3.0",
"minimatch": "^3.0.4",
"morgan": "^1.8.2",
"pg": "^7.3.0"
},
"devDependencies": {
"chai": "^4.1.2",
"grunt": "^1.0.1",
"grunt-cafe-mocha": "^0.1.13",
"grunt-contrib-jshint": "^1.1.0",
"grunt-exec": "^3.0.0",
"mocha": "^3.5.3",
"selenium-webdriver": "^3.5.0"
}
}
我碰到下面的錯誤,當我嘗試git push heroku master
:
parse error: Invalid numeric literal at line 7, column 22
但我不能找出錯誤?問題是什麼 ? package.json文件是自動創建的。我手工創建的唯一東西是heroku需要的「引擎」入口。什麼是錯誤?
編輯:如果我刪除這些三線,該錯誤消失:
"engines": {
"node": "6.11.2"
},
有人可以解釋的問題是什麼?
爲什麼你認爲錯誤來自於這個文件? – awd
因爲當我嘗試「git push heroku master」時,它說無法解析package.json,然後說上面的解析錯誤... –
通常,當您複製粘貼代碼時會出現此類錯誤,有時候在那裏是不可見的字節...... –