安装npm install时出错grunt-contrib-clean --dev-save

时间:2015-12-10 05:28:09

标签: javascript gruntjs

以下是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.

1 个答案:

答案 0 :(得分:1)

您的package.json文件无法解析,因为您在

末尾错过了逗号
"grunt": "^0.4.5"

此外,该选项为--save-dev而不是--dev-save