参照: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. DLL入门浅析(5)——使用DLL在进程间共享数据

    转载自:http://www.cppblog.com/suiaiguo/archive/2009/07/21/90734.html 在Win16环境中,DLL的全局数据对每个载入它的进程来说都是相同的 ...

  2. [Java] 实例创建的步骤

    创建类的一个实例时,按照下面步骤进行创建: 1. 给当前类及其父.祖类的所有成员字段分配空间,并给它们赋予默认值 2. 开始执行当前类的构造器 3. 如果当前类有父类,则对父类创建一个实例:从第 2 ...

  3. java中的接口和抽象类是什么?

    抽象类与接口的区别 abstract class和interface是Java语言中对于抽象类定义进行支持的两种机制,正是由于这两种机制的存在,才赋予了Java强大的面向对象能力.abstract c ...

  4. SpringMVC 之文件上传 MultipartResolver

    基于前面文章的基础上. 一.准备 需要的jar  二.配置 1.  spmvc-servlet.xml <?xml version="1.0" encoding=" ...

  5. POJ2230 Watchcow【欧拉回路】

    Watchcow Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 6172Accepted: 2663 Special Judge ...

  6. ios开发应用内实现多语言自由切换

    需求描述:应用内部有一按钮,点击切换语言(如中英文切换).说起来这个是好久以前做的一个功能点了,刚开始也是没有头绪,后来解决了发现很简单,把方法分享一下.1.原理.查看NSLocalizedStrin ...

  7. IIS部署FTP服务器步骤

    本文介绍如何在IIS中部署FTP服务端.首先确认windows开启了ftp功能:确认方法:进入控制面板->程序->打开或关闭windows功能如下图所示: 确认FTP勾选 确认后打开IIS ...

  8. XgCalendar日历插件动态添加参数

    在使用xgcalendar日历插件的时候,参数数组并非只有类型.显示时间.时区等这些参数,还可以根据extParam自定义参数扩展搜索条件,例如根据用户Id搜索不同用户的日历信息,需要将用户的Id存在 ...

  9. Java基础知识强化82:Random类概述和方法使用

    1. Random类 public class Random extends Object implements Serializable: 此类的实例用于生成伪随机数流.此类使用48位种子. (1) ...

  10. 大数据笔记06:大数据之Hadoop的HDFS(文件的读写操作)

    1. 首先我们看一看文件读取: (1)客户端(java程序.命令行等等)向NameNode发送文件读取请求,请求中包含文件名和文件路径,让NameNode查询元数据. (2)接着,NameNode返回 ...