运行环境CMD
NODEJS版本v0.8.4 node --version
需求:需要用到Grunt的JS编译功能,各位别笑我。
使用代理
npm config set proxy http://ip:port
npm config set npaturl http://npat.npmjs.org/
安装完grunt-cli报错
> grunt
[plain] view plaincopy
- grunt-cli: The grunt command line interface. (v0.1.13)
- Fatal error: Unable to find local grunt.
- If you‘re seeing this message, either a Gruntfile wasn‘t found or grunt
- hasn‘t been installed locally to your project. For more information about
- installing and configuring grunt, please see the Getting Started guide:
- http://gruntjs.com/getting-started
看文件意思是缺少Gruntfile或者项目里没有安装grunt,结果我上网搜不到准确结果。
下载到本地
>npm install grunt
>grunt
[plain] view plaincopy
- >> Local Npm module "grunt-contrib-copy" not found. Is it installed?
- >> Local Npm module "grunt-contrib-concat" not found. Is it installed?
- >> Local Npm module "grunt-contrib-uglify" not found. Is it installed?
- >> Local Npm module "grunt-css" not found. Is it installed?
- Warning: Task "concat" not found. Use --force to continue.
- Aborted due to warnings.
这些是Gruntfile.js中引用的,分别下载。ok
npm install grunt-contrib-copy
npm install grunt-contrib-concat
npm install grunt-contrib-uglify
npm install grunt-css
下载过程有版本号问题,需要单独下载 npm install [email protected]
转载 http://blog.csdn.net/phoenix2121/article/details/25910919
时间: 2024-10-28 20:24:05