使用NodeJS、GruntCLI遇到的问题

运行环境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 plain  copy
  1. grunt-cli: The grunt command line interface. (v0.1.13)  
  2.   
  3. Fatal error: Unable to find local grunt.  
  4.   
  5. If you're seeing this message, either a Gruntfile wasn't found or grunt  
  6. hasn't been installed locally to your project. For more information about  
  7. installing and configuring grunt, please see the Getting Started guide:  
  8.   
  9. http://gruntjs.com/getting-started  

看文件意思是缺少Gruntfile或者项目里没有安装grunt,结果我上网搜不到准确结果。


 下载到本地

>npm install grunt

>grunt

[plain]  view plain  copy
  1. >> Local Npm module "grunt-contrib-copy" not found. Is it installed?  
  2. >> Local Npm module "grunt-contrib-concat" not found. Is it installed?  
  3. >> Local Npm module "grunt-contrib-uglify" not found. Is it installed?  
  4. >> Local Npm module "grunt-css" not found. Is it installed?  
  5. Warning: Task "concat" not found. Use --force to continue.  
  6.   
  7. 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 name@version


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值