参照: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. war文件

    原文地址:http://blog.sina.com.cn/s/blog_4cbc6fdd0100fojv.html jar包和war包的区别:war是一个web模块,其中需要包括WEB-INF,是可以 ...

  2. OpenStack Networking

    今天的数据中心网络比以往不论什么时候包括的设备都要多,比如server.网络设备.存储系统和安全设备等.这当中有非常多被近一步划分为多个虚拟机和虚拟网络.IP地址的数量.路由配置和安全规则能够迅速达到 ...

  3. HDU 2853 Assignment(KM最大匹配好题)

    HDU 2853 Assignment 题目链接 题意:如今有N个部队和M个任务(M>=N),每一个部队完毕每一个任务有一点的效率,效率越高越好.可是部队已经安排了一定的计划,这时须要我们尽量用 ...

  4. SQL给查询结果加序号

    情境:在用delphi7编程时,想要给查询出的结果一个编号,比方有一万条结果,就自己主动从1编号到10000 显示数据时用的是DBGrid控件,可是它的第一列无法非常好的显示编号,找了非常多方法都不能 ...

  5. Linux入门基础 #6:Linux用户基础

    本文出自   http://blog.csdn.net/shuangde800 ------------------------------------------------------------ ...

  6. ORACLE函数之单行数字函数

     1.           ABS(X) 返回X的绝对值 SQL>SELECT ABS(-1) A,ABS(1) B,ABS(0) C FROM DUAL; A          B     ...

  7. 关于centos6.5系统安装FTP服务和配置的方法

    一般在配置服务器的时候,涉及到代码上传,通常都要用到FTP方式. 1.先查看系统是否安装vsftpd: rpm -qa | grep vsftpd 如果出现vsftpd-2.2.2-14......字 ...

  8. MM32 RTC学习(兼容STM32)

    RTC学习 RTC简述 实时时钟是一个独立的定时器. RTC模块拥有一组连续计数的计数器,在相应软件配置下,可提供时钟日历的功能. 修改计数器的值可以重新设置系统当前的时间和日期. RTC模块和时钟配 ...

  9. nginx 根据IP 进行灰度发布

    灰度发布,简单来说,就是根据各种条件,让一部分用户使用旧版本,另一部分用户使用新版本. nginx 的语法本身可以看作是一门小型的编程语言,通过简单的编程,可以轻松实现基于IP的灰度发布. 需求:搭建 ...

  10. MyEclipse保存文件时 自动格式化代码! 不包括文档注释

    设置不格式化 文档注释