撰写package.json
时:
"scripts": {
"preinstall": "npm install -g grunt-cli"
},
"devDependencies": {
"async": "^0.9.0",
"grunt": "^0.4.5",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "^0.6.0",
"grunt-contrib-watch": "^0.6.1",
"jit-grunt": "^0.9.0",
"marked": "^0.3.2",
"time-grunt": "^1.0.0",
"underscore": "^1.7.0"
}
然后运行命令npm install
它适用于某些计算机但在某些计算机上我收到此错误: http://pastebin.com/rYUwhV5k
正确使用package.json
吗?
还有其他办法吗?
如何解决其他计算机上出现的问题?
答案 0 :(得分:2)
根据npm文档"注意:安装脚本是反地图" https://docs.npmjs.com/misc/scripts
在您的情况下,最好只是添加readme.md,您需要安装grunt来运行测试(并让用户决定如何安装它)