疯狂地试图安装Yeoman

时间:2013-10-30 15:28:09

标签: shell yeoman

我是一个努力探索Yeoman的小伙子,但即使只是让事情运转,我仍然遇到问题。我想,随着时间的推移,在探索Node.js,Bower,Grunt之后,我只是捣乱我的终端,我已经把事情弄得一团糟。我不确定如何在这一点上获得一个清洁的板块或最好的前进方式。我已经尝试完全卸载节点并重新启动,但正如我所说,它并不是一个完全干净的平板。

无论如何,这就是我现在所处的位置:

$ node -v
v0.10.21

$ npm -v
1.3.11

$ npm install -g yo generator-generator
npm http GET https://registry.npmjs.org/yo
npm http GET https://registry.npmjs.org/generator-generator
npm http 304 https://registry.npmjs.org/generator-generator
npm http 304 https://registry.npmjs.org/yo
npm http GET https://registry.npmjs.org/yeoman-generator
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/update-notifier
npm http GET https://registry.npmjs.org/insight
npm http GET https://registry.npmjs.org/sudo-block
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/open/0.0.4
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/github
npm http GET https://registry.npmjs.org/yeoman-generator
npm http 304 https://registry.npmjs.org/yeoman-generator
npm http 304 https://registry.npmjs.org/insight
npm http 304 https://registry.npmjs.org/update-notifier
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/sudo-block
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/open/0.0.4
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/github
npm http 304 https://registry.npmjs.org/yeoman-generator
npm http GET https://registry.npmjs.org/has-color
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/configstore
npm http GET https://registry.npmjs.org/inquirer
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/diff
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/underscore.string
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/isbinaryfile
npm http GET https://registry.npmjs.org/dargs
npm http GET https://registry.npmjs.org/inquirer
npm http GET https://registry.npmjs.org/iconv-lite
npm http GET https://registry.npmjs.org/shelljs
npm http GET https://registry.npmjs.org/findup-sync
npm http GET https://registry.npmjs.org/text-table
npm http GET https://registry.npmjs.org/cheerio
npm http GET https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/has-color
npm http 304 https://registry.npmjs.org/configstore
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/inquirer
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/tar
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/diff
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/isbinaryfile
npm http 304 https://registry.npmjs.org/dargs
npm http 304 https://registry.npmjs.org/inquirer
npm http 304 https://registry.npmjs.org/iconv-lite
npm http 304 https://registry.npmjs.org/text-table
npm http 304 https://registry.npmjs.org/findup-sync
npm http 304 https://registry.npmjs.org/shelljs
npm http GET https://registry.npmjs.org/cli-color
npm http GET https://registry.npmjs.org/mute-stream/0.0.3
npm http 304 https://registry.npmjs.org/cheerio
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http 304 https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/mute-stream/0.0.3
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/cli-color
npm http 304 https://registry.npmjs.org/hawk
npm http 304 https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/cookie-jar
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/http-signature
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/block-stream
npm http GET https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/entities
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/cheerio-select
npm http GET https://registry.npmjs.org/htmlparser2/3.1.4
npm http GET https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/argparse
npm http GET https://registry.npmjs.org/es5-ext
npm http GET https://registry.npmjs.org/memoizee
npm http GET https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/htmlparser2/3.1.4
npm http 304 https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/entities
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/cheerio-select
npm http 304 https://registry.npmjs.org/argparse
npm http 304 https://registry.npmjs.org/es5-ext
npm http 304 https://registry.npmjs.org/memoizee
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/CSSselect
npm http 304 https://registry.npmjs.org/CSSselect
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http GET https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/CSSwhat
npm http GET https://registry.npmjs.org/domutils
npm http GET https://registry.npmjs.org/event-emitter
npm http GET https://registry.npmjs.org/next-tick
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/CSSwhat
npm http GET https://registry.npmjs.org/domelementtype
npm http GET https://registry.npmjs.org/readable-stream
npm http GET https://registry.npmjs.org/domhandler
npm http GET https://registry.npmjs.org/domutils
npm http 304 https://registry.npmjs.org/domutils
npm http 304 https://registry.npmjs.org/event-emitter
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/hoek
npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/domelementtype
npm http 304 https://registry.npmjs.org/next-tick
npm http 304 https://registry.npmjs.org/readable-stream
npm http 304 https://registry.npmjs.org/domhandler
npm http 304 https://registry.npmjs.org/domutils
/Users/skube/.node/bin/yo -> /Users/skube/.node/lib/node_modules/yo/bin/yo
yo@1.0.4 /Users/skube/.node/lib/node_modules/yo
├── open@0.0.4
├── async@0.2.9
├── chalk@0.2.1 (has-color@0.1.1, ansi-styles@0.2.0)
├── lodash@1.3.1
├── nopt@2.1.2 (abbrev@1.0.4)
├── sudo-block@0.2.1 (chalk@0.1.1)
├── insight@0.2.0 (inquirer@0.2.5, request@2.27.0, configstore@0.1.5)
├── update-notifier@0.1.7 (semver@2.1.0, request@2.27.0, configstore@0.1.5)
└── yeoman-generator@0.13.4 (dargs@0.1.0, diff@1.0.7, debug@0.7.2, text-table@0.1.1, mime@1.2.11, isbinaryfile@0.1.9, rimraf@2.2.2, mkdirp@0.3.5, shelljs@0.1.4, glob@3.2.6, tar@0.1.18, underscore.string@2.3.3, iconv-lite@0.2.11, findup-sync@0.1.2, cheerio@0.12.3, request@2.25.0, inquirer@0.3.4)

generator-generator@0.3.0 /Users/skube/.node/lib/node_modules/generator-generator
├── github@0.1.12
└── yeoman-generator@0.13.4 (chalk@0.2.1, dargs@0.1.0, async@0.2.9, diff@1.0.7, debug@0.7.2, text-table@0.1.1, mime@1.2.11, isbinaryfile@0.1.9, rimraf@2.2.2, mkdirp@0.3.5, glob@3.2.6, tar@0.1.18, shelljs@0.1.4, findup-sync@0.1.2, lodash@1.3.1, underscore.string@2.3.3, iconv-lite@0.2.11, cheerio@0.12.3, request@2.25.0, inquirer@0.3.4)

My $ PATH:

    $ echo $PATH
/usr/local/share/npm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin

但是当我尝试运行Yeoman时

$ yo
-bash: yo: command not found

1 个答案:

答案 0 :(得分:2)

在输出底部附近,它会在yo列出/Users/skube/.node/bin/yo可执行文件。您可以尝试使用该完整路径运行它,以确保它有效。

有两种方法可以让它正常工作:

  1. /Users/skube/.node/bin添加到您的PATH
  2. 卸载软件包,然后通过类似sudo npm install -g yo generator-generator的方式将它们全局安装。这会将可执行文件放在全局路径中(例如/usr/bin,至少在我的系统上),因此它们已经在您的路径中。
  3. 我一般会推荐选项(1),但这一切都取决于你要对你正在安装的软件包做些什么。