我希望我的Package.json像这样
{
"name": "Billing",
"version": "0.0.0",
"dependencies": {
"grunt": "~0.4.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-compass": "~0.5.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-cssmin": "~0.6.2",
"matchdep": "~0.1.2"
},
"devDependencies": {
"grunt-contrib-handlebars": "~0.5.4",
"grunt-contrib-less": "~0.8.1"
}
}我试过使用npm install,但是得到了这个错误
package.json必须是实际的JSON,而不仅仅是JavaScript。
因此,我使用命令行来创建json,并添加了依赖项。我发现,大多数软件包都是在没有出现错误的情况下安装的,我的package.json也通过使用npm install grunt-contrib-watch --save-dev等方式得到了正确的更新。
在Windows上,我只看到了两个包的错误:对于grunt-cont肋骨-uglify,以及grunt-cont肋骨-节。所以我的JSON文件以
{
"name": "Billing",
"version": "0.0.0",
"dependencies": {
"grunt": "~0.4.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-compass": "~0.5.0",
"grunt-contrib-cssmin": "~0.6.2",
"matchdep": "~0.1.2"
},
"devDependencies": {
"grunt-contrib-less": "~0.8.1"
}
}发布于 2013-11-03 05:23:17
似乎您的package.json中有一个错误。C:\Users\zm2759\AppData\Roaming\npm-cache\wordwrap\0.0.2\package\package.json里的那个。由于它在npm缓存中,我相信您可以使用npm cache clean清除它.
否则,您自己的package.json似乎没有问题。
https://stackoverflow.com/questions/19743779
复制相似问题