以下是package.json
文件
{
"name": "gruntTutorial.js",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"grunt": "^0.4.5"
"grunt-contrib-clean":"^0.5.0"
}
}
拥有此package.json
文件,同时安装npm install grunt-contrib-clean --dev-save
我收到以下错误。
C:\Users\prasad\Office\grunt>npm install grunt-contrib-clean --dev-save
C:\Users\prasad\Office\grunt
└── grunt-contrib-clean@0.7.0
npm WARN EJSONPARSE Failed to parse json
npm WARN EJSONPARSE Unexpected token 'g' at 13:6
npm WARN EJSONPARSE "grunt-contrib-clean":"^0.5.0"
npm WARN EJSONPARSE ^
npm WARN EPACKAGEJSON grunt No description
npm WARN EPACKAGEJSON grunt No repository field.
npm WARN EPACKAGEJSON grunt No README data
npm WARN EPACKAGEJSON grunt No license field.
答案 0 :(得分:1)
您的package.json
文件无法解析,因为您在
"grunt": "^0.4.5"
此外,该选项为--save-dev
而不是--dev-save
。