参照: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. Migration workstation vms to openstack kvm

    Migration workstation vms to openstack kvm 分别分成(磁盘是否拆分,vms 是否 有多个磁盘驱动器) 1, linux迁移 vmware workstatio ...

  2. sql server 2005中IMAGE类型的BUG问题

    目的:在sql server 2005数据库上筛选出那些有照片的员工 由于客户之前的数据库是sql server 2000,定义的photo字段的数据类型为image, 在sql 2005数据库上,用 ...

  3. JS~字符串长度判断,超出进行自动截取(支持中文)

    今天一个小弟问我的问题,在文本框中输入字符,如果超出指定长度,就把它截取,要求中文等于两个字符的长度,我找一下资料,把这个功能实现了,下面是JS代码: <html> <script ...

  4. SKPhysicsJointPin类

    继承自 NSObject 符合 NSCoding(SKPhysicsJoint)NSObject(NSObject) 框架  /System/Library/Frameworks/SpriteKit. ...

  5. C# 自己定义 implicit和explicit转换

    explicit 和 implicit 属于转换运算符,如用这两者能够让我们自己定义的类型支持相互交换explicti 表示显式转换.如从 A -> B 必须进行强制类型转换(B = (B)A) ...

  6. 具体解释VB中连接access数据库的几种方法

    在VB中,连接ACCESS数据库的方法主要有以下三种 使用ADO对象,通过编写代码訪问数据库 Connection 对象 ODBC数据源 使用ADO Data 控件高速创建数据库连接 有三种连接方法 ...

  7. apache利用.htaccess实现部分页面301

    由于网站改版,对访问url进行了改进 原:http://www.tutufu.com/w_weifenlei/DeHaiZi_38251/ 现:http://www.tutufu.com/unclas ...

  8. Difference between Tomcat's extraResourcePaths and aliases to access an external directory--转

    Question: Simple question: In Tomcat7, what's the difference between using extraResourcePaths and al ...

  9. nginx 2.基本配置

    死磕nginx 2.基本配置 鉴于深入浅出的原理,我们先从一个简单的配置了解nginx的配置 1.一个典型配置 nginx的配置文件默认在nginx安装目录的conf二级目录下面,主配置文件为 ngi ...

  10. 在java代码中显示json字符串(怎么避免json字符串中双引号在java代码中显示)

    String log = "eyJvcmRlckluZm8iOnsiaWQiOjEwNzQwNCwib3JkZXJJZCI6MjczNjQyMSwicHJvZHVjdENvZGUiOjQ1N ...