我有一个包含以下内容的package.json:
{
"name": "useless-app",
"version": "1.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.4.0",
"grunt-contrib-concat": "~0.2.0",
"grunt-contrib-coffee": "~0.6.6",
"grunt-contrib-jst": "~0.5.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-compass": "~0.2.0",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-cssmin": "~0.6.0",
"grunt-contrib-connect": "0.3.0",
"grunt-contrib-clean": "0.4.0",
"grunt-contrib-htmlmin": "0.1.3",
"grunt-contrib-imagemin": "0.1.4",
"grunt-contrib-livereload": "0.1.2",
"grunt-mocha": "~0.3.1",
"grunt-bower-requirejs": "~0.4.1",
"grunt-usemin": "~0.1.10",
"grunt-requirejs": "~0.3.5",
"grunt-regarde": "~0.1.1",
"grunt-open": "~0.2.0",
"matchdep": "~0.1.2"
},
"engines": {
"node": ">=0.8.0"
}
}这就是约曼为我打造的标准。当我调用npm install或npm install -g时,我得不到任何操作,只有这样:
Alex@iMac-2 ~/Sites/Backbone/Yeoman$ sudo npm install -g
useless-app@1.0.0 /usr/local/lib/node_modules/useless-app在这一点上,我有点期待一个正在下载和安装的应用程序列表。无论采用哪种方法,通过运行grunt (列表中的一项)来测试,都会得到以下结果:
Alex@iMac-2 ~/Sites/Backbone/Yeoman$ grunt
-bash: grunt: command not found你知道为什么这些东西没有安装吗?
我尝试过使用sudo来执行这些命令,结果总是一样的。
发布于 2013-05-09 15:17:55
你安装了grunt cli了吗?请记住,在最新版本的Grunt中,您需要使用grunt-cli才能执行grunt命令。
试试sudo npm install -g grunt-cli
最好的问候,凯文。
发布于 2020-04-19 04:23:02
对于遇到类似问题的任何人,请尝试在您的终端上运行rm -rf node_modules,然后再次运行npm install。
https://stackoverflow.com/questions/16427355
复制相似问题