• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
交流空间
博客园    首页    新随笔    联系   管理    订阅  订阅
使用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 plaincopy在CODE上查看代码片派生到我的代码片
 
  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 plaincopy在CODE上查看代码片派生到我的代码片
 
  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

 

转载 http://blog.csdn.net/phoenix2121/article/details/25910919

posted on 2015-04-11 17:18  月阳  阅读(1055)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3