参照:http://yeoman.io/codelab/setup.html

1:$npm install --global yo bower grunt-cli

提示以下错误

npm ERR! tar.unpack untar error /home/y/.npm/grunt-cli/0.1./package.tgz
npm ERR! tar.unpack untar error /home/y/.npm/yo/1.4./package.tgz
npm ERR! tar.unpack untar error /home/y/.npm/bower/1.4./package.tgz
npm ERR! Linux 3.13.--generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--global" "yo" "bower" "grunt-cli"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! path /usr/local/lib/node_modules/grunt-cli
npm ERR! code EACCES
npm ERR! errno - npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/grunt-cli'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/grunt-cli']
npm ERR! errno: -,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/grunt-cli',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/grunt-cli',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:95:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator. npm ERR! Please include the following file with any support request:
npm ERR! /home/y/npm-debug.log

解决方法参照:https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md

(1)mkdir "${HOME}/.npm-packages"
(2).bashrc
NPM_PACKAGES="${HOME}/.npm-packages"
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
PATH="$NPM_PACKAGES/bin:$PATH"
unset MANPATH # delete if you already modified MANPATH elsewhere in your config
MANPATH="$NPM_PACKAGES/share/man:$(manpath)"

(3)$HOME/.npmrc
prefix=${HOME}/.npm-packages

2:再次安装:y@y:~$ npm install --global yo bower grunt-cli

提示:npm WARN optional dep failed, continuing uglify-js@~2.3

解决方法:y@y:~$sudo npm cache clean

3:查看npm配置信息

y@y:~$ npm config get prefix
/home/y/.npm-packages

进行安装:y@y:~$ npm install --global yo bower grunt-cli

/home/y/.npm-packages/bin/grunt -> /home/y/.npm-packages/lib/node_modules/grunt-cli/bin/grunt
/home/y/.npm-packages/bin/yo -> /home/y/.npm-packages/lib/node_modules/yo/lib/cli.js > yo@1.4. postinstall /home/y/.npm-packages/lib/node_modules/yo
> yodoctor -
Yeoman Doctor
Running sanity checks on your system ✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory Everything looks all right!
/home/y/.npm-packages/bin/bower -> /home/y/.npm-packages/lib/node_modules/bower/bin/bower
grunt-cli@0.1. /home/y/.npm-packages/lib/node_modules/grunt-cli
├── resolve@0.3.
├── nopt@1.0. (abbrev@1.0.)
└── findup-sync@0.1. (lodash@2.4., glob@3.2.) yo@1.4. /home/y/.npm-packages/lib/node_modules/yo
├── titleize@1.0.
├── array-uniq@1.0.
├── figures@1.3.
├── user-home@1.1.
├── opn@1.0.
├── async@0.9.
├── cross-spawn@0.2. (lru-cache@2.6.)
├── lodash@3.8.
├── yeoman-character@1.0. (supports-color@1.3.)
├── string-length@1.0. (strip-ansi@2.0.)
├── humanize-string@1.0. (decamelize@1.0.)
├── sort-on@1.2. (dot-prop@2.0.)
├── findup@0.1. (commander@2.1., colors@0.6.)
├── chalk@1.0. (escape-string-regexp@1.0., ansi-styles@2.0., supports-color@1.3., strip-ansi@2.0., has-ansi@1.0.)
├── update-notifier@0.3. (is-npm@1.0., latest-version@1.0., semver-diff@2.0.)
├── got@2.9. (object-assign@2.0., lowercase-keys@1.0., is-stream@1.0., timed-out@2.0., prepend-http@1.0., nested-error-stacks@1.0., statuses@1.2., infinity-agent@2.0., read-all-stream@2.1., duplexify@3.3.)
├── root-check@1.0. (downgrade-root@1.1., sudo-block@1.2.)
├── npm-keyword@1.1. (registry-url@3.0.)
├── package-json@1.1. (registry-url@3.0.)
├── fullname@1.1. (npmconf@2.1.)
├── yosay@1.0. (ansi-regex@1.1., ansi-styles@2.0., strip-ansi@2.0., word-wrap@1.0., pad-component@0.0., taketalk@1.0., minimist@1.1.)
├── configstore@0.3. (object-assign@2.0., xdg-basedir@1.0., osenv@0.1., graceful-fs@3.0., uuid@2.0., mkdirp@0.5., js-yaml@3.3.)
├── yeoman-environment@1.2. (escape-string-regexp@1.0., log-symbols@1.0., untildify@2.0., diff@1.4., text-table@0.2., debug@2.1., globby@1.2., grouped-queue@0.3., mem-fs@1.1.)
├── meow@3.1. (object-assign@2.0., minimist@1.1., camelcase-keys@1.0., indent-string@1.2.)
├── yeoman-doctor@1.3. (object-values@1.0., log-symbols@1.0., each-async@1.1., twig@0.7.)
├── insight@0.5. (object-assign@2.0., lodash.debounce@3.0., tough-cookie@0.12., os-name@1.0., request@2.55.)
└── inquirer@0.8. (ansi-regex@1.1., cli-width@1.0., through@2.3., readline2@0.1., rx@2.5.) bower@1.4. /home/y/.npm-packages/lib/node_modules/bower
├── is-root@1.0.
├── junk@1.0.
├── stringify-object@1.0.
├── abbrev@1.0.
├── user-home@1.1.
├── which@1.0.
├── chmodr@0.1.
├── rimraf@2.3.
├── archy@1.0.
├── opn@1.0.
├── bower-logger@0.2.
├── bower-endpoint-parser@0.2.
├── graceful-fs@3.0.
├── lockfile@1.0.
├── lru-cache@2.6.
├── nopt@3.0.
├── retry@0.6.
├── tmp@0.0.
├── q@1.3.
├── semver@2.3.
├── fstream@1.0. (inherits@2.0.)
├── mout@0.11.
├── p-throttler@0.1. (q@0.9.)
├── request-progress@0.3. (throttleit@0.0.)
├── bower-json@0.4. (intersect@0.0., deep-extend@0.2., graceful-fs@2.0.)
├── shell-quote@1.4. (array-filter@0.0., array-reduce@0.0., array-map@0.0., jsonify@0.0.)
├── promptly@0.2. (read@1.0.)
├── chalk@1.0. (escape-string-regexp@1.0., ansi-styles@2.0., supports-color@1.3., strip-ansi@2.0., has-ansi@1.0.)
├── github@0.2. (mime@1.3.)
├── fstream-ignore@1.0. (inherits@2.0., minimatch@2.0.)
├── glob@4.5. (inherits@2.0., inflight@1.0., once@1.3., minimatch@2.0.)
├── tar-fs@1.5. (pump@1.0., tar-stream@1.1.)
├── decompress-zip@0.1. (mkpath@0.1., touch@0.0., readable-stream@1.1., binary@0.3.)
├── mkdirp@0.5. (minimist@0.0.)
├── bower-config@0.6. (osenv@0.0., graceful-fs@2.0., mout@0.9., optimist@0.6.)
├── update-notifier@0.3. (is-npm@1.0., string-length@1.0., semver-diff@2.0., latest-version@1.0.)
├── insight@0.5. (object-assign@2.0., async@0.9., lodash.debounce@3.0., tough-cookie@0.12., os-name@1.0.)
├── cardinal@0.4. (ansicolors@0.2., redeyed@0.4.)
├── request@2.53. (caseless@0.9., json-stringify-safe@5.0., aws-sign2@0.5., forever-agent@0.5., stringstream@0.0., oauth-sign@0.6., tunnel-agent@0.4., isstream@0.1., node-uuid@1.4., qs@2.3., form-data@0.2., bl@0.9., tough-cookie@1.1., combined-stream@0.0., mime-types@2.0., http-signature@0.10., hawk@2.3.)
├── bower-registry-client@0.3. (graceful-fs@2.0., request-replay@0.2., rimraf@2.2., lru-cache@2.3., async@0.2., mkdirp@0.3., request@2.51.)
├── handlebars@2.0. (optimist@0.3., uglify-js@2.3.)
├── configstore@0.3. (object-assign@2.0., xdg-basedir@1.0., osenv@0.1., uuid@2.0., js-yaml@3.3.)
└── inquirer@0.8. (figures@1.3., ansi-regex@1.1., mute-stream@0.0., through@2.3., lodash@2.4., readline2@0.1., rx@2.5., chalk@0.5., cli-color@0.3.)

4:检查是否安装成功

y@y:~$ yo --version && bower --version && grunt --version
1.4.
1.4.
grunt-cli v0.1.13

Install the Yeoman toolset的更多相关文章

  1. Try out the latest C++ compiler toolset without waiting for the next update of Visual Studio

    Updated 22/Apr/2016: The NuGet package is now being uploaded daily. The payload doesn’t change every ...

  2. 好文推荐系列---------(4)使用Yeoman自动构建Ember项目

    好文原文地址:http://segmentfault.com/a/1190000000368881 我决定学习前端开发的效率工具Yeoman.本文将首先介绍Yeoman的基本情况,接着我们会使用Yeo ...

  3. DotNet 资源大全中文版(Awesome最新版)

    Awesome系列的.Net资源整理.awesome-dotnet是由quozd发起和维护.内容包括:编译器.压缩.应用框架.应用模板.加密.数据库.反编译.IDE.日志.风格指南等. 算法与数据结构 ...

  4. 阿里云centos 安装 nodejs npm express

    yum check-update yum install vsftpdvi /etc/vsftpd/vsftpd.conf anonymous_enable=NO service vsftpd sta ...

  5. npm 安装与常用命令

    下载nodejs并安装,会附带安装npm工具https://nodejs.org/en/download/ npm 常用命令#在执行命令时需要管理员权限,mac请用sudo来执行,windows请使用 ...

  6. Solve Error: node postinstall sh: node: command not found

    When install the yeoman using the following command: npm install -g yo You might have the following ...

  7. boost 1.67编译VS2017版本

    最近想系统学习并使用一下boost的asio异步网络库,所以需要编译boost库使用,下面简单介绍如何编译. 编译环境 boost1.67版本,windows 10,VS2017 下载boost 建议 ...

  8. 【资源大全】.NET资源大全中文版(Awesome最新版)

    算法与数据结构(Algorithms and Data structures) 应用程序接口(API) 应用程序框架(Application Frameworks) 模板引擎(Application ...

  9. Yeoman 官网教学案例:使用 Yeoman 构建 WebApp

    STEP 1:设置开发环境 与yeoman的所有交互都是通过命令行.Mac系统使用terminal.app,Linux系统使用shell,windows系统可以使用cmder/PowerShell/c ...

随机推荐

  1. Emacs学习阶段小结-Emacs常用快捷键总结

    首先推荐一下Emacs自带的Emacs Tutorial,跟着这个做一边,两三个小时,基本的使用就能掌握了.之后的神教程就有很多了,比如<Sams.Teach.Yourself.Emacs.in ...

  2. C#日历上显示节气、阴阳历节假日信息

    近期在做一个工作日历,想在日历上设置工作日,显示请假.加班等相关信息,显示农历日期信息(包括农历日期.节日 .节气).公历信息(节假期). 不能不说,http://www.cnblogs.com/ho ...

  3. JavaScript的闭包详解

    (1)定义: 函数内部返回一个函数,返回出来的这个函数叫做被我们称之为闭包(个人理解的最简单的表现形式,) (2)为什么要使用闭包呢? 局部变量在函数执行完之后就会被GC回收,有时候我们想在外部访问内 ...

  4. 标准简单SP模板(sql server)

    CREATE Procedure eSP_ChangeStart --eSP_ChangeStart 64 @ID int, Output As Declare ), @ID_Max int Begi ...

  5. jquery切换tab标签例子

    之前做了一个简单的小效果,使用jquery方式,让tab标签切换,效果如下 代码其实很简单,首先先把代码分享给大家,代码如下 var shoptoggle = $('.shoptoggle .shop ...

  6. "ping: unknown host www.baidu.com" 解决方法

    如果某台Linux服务器ping不通域名, 如下提示: # ping www.baidu.comping: unknown host www.baidu.com 如果确定网络没问题的情况下, 可以通过 ...

  7. gulp入门学习

    一.gulp简介 gulp是一个自动化构建工具.在开发过工程中,能够使用gulp对项目进行自动构建,大大提高工作效率. 二.安装gulp 在安装gulp之前先要确认已经正确安装了node.js,然后在 ...

  8. AsyncTask两种线程池

        AsyncTask两种线程池  http://bbs.51cto.com/thread-1114378-1.html (API 3.0以后): 1.THREAD_POOL_EXECUTOR, ...

  9. java里面List和Array的区别是什么?

    java里面的List和Array的区别是什么? 1:数组是定长,list是自动增长.2:数组效率高,list效率低.总结:数组牺牲功能增加效率,list牺牲效率增加功能. http://bbs.cs ...

  10. 系统管理中 bash shell 脚本常用方法总结

    在日常系统管理工作中,需要编写脚本来完成特定的功能,编写shell脚本是一个基本功了!在编写的过程中,掌握一些常用的技巧和语法就可以完成大部分功能了,也就是2/8原则 1. 单引号和双引号的区别 单引 ...