gpt4 book ai didi

ubuntu - 在 ubuntu 上安装 Yeoman 时出错

转载 作者:太空宇宙 更新时间:2023-11-03 16:50:38 27 4
gpt4 key购买 nike

当我尝试在 ubuntu 上安装 Yeoman 时出现以下错误。

enter image description here

harsha@harshamv:~$ sudo npm install yo -g
[sudo] password for harsha:
npm http GET https://registry.npmjs.org/yo
npm http 304 https://registry.npmjs.org/yo
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/async
npm http GET https://registry.npmjs.org/sudo-block
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/findup
npm http GET https://registry.npmjs.org/shelljs
npm http GET https://registry.npmjs.org/yeoman-generator
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/update-notifier
npm http 304 https://registry.npmjs.org/insight
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/open/0.0.4
npm http 304 https://registry.npmjs.org/findup
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/sudo-block
npm http 304 https://registry.npmjs.org/yeoman-generator
npm http 304 https://registry.npmjs.org/shelljs
npm http 304 https://registry.npmjs.org/async
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/strip-ansi
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://github.com/Filirom1/nopt/tarball/master#pull-request-in-progress
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/cheerio
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/diff
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/underscore.string
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/debug
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/findup-sync
npm http GET https://registry.npmjs.org/text-table
npm http GET https://registry.npmjs.org/download
npm http GET https://registry.npmjs.org/file-utils
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/class-extend
npm http 304 https://registry.npmjs.org/has-color
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/strip-ansi
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/configstore
npm http 304 https://registry.npmjs.org/inquirer
npm http 304 https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/cheerio
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/diff
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/cli-color
npm http GET https://registry.npmjs.org/mute-stream/0.0.3
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/forever-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 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/isbinaryfile
npm http 304 https://registry.npmjs.org/dargs
npm http 304 https://registry.npmjs.org/findup-sync
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/download
npm http 304 https://registry.npmjs.org/file-utils
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/class-extend
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/decompress
npm http GET https://registry.npmjs.org/each-async
npm http GET https://registry.npmjs.org/through2
npm http 304 https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/cli-color
npm http 304 https://registry.npmjs.org/mute-stream/0.0.3
npm http 304 https://registry.npmjs.org/qs
npm http 200 https://github.com/Filirom1/nopt/tarball/master#pull-request-in-progress
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/aws-sign2
npm http 304 https://registry.npmjs.org/http-signature
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/through
npm http GET https://registry.npmjs.org/mute-stream/0.0.4
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/es5-ext
npm http GET https://registry.npmjs.org/memoizee
npm http 304 https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/inherits
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/oauth-sign
npm http GET https://registry.npmjs.org/argparse
npm http GET https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/decompress
npm http 304 https://registry.npmjs.org/each-async
npm http 304 https://registry.npmjs.org/through2
npm http GET https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/tough-cookie
npm http 304 https://registry.npmjs.org/aws-sign2
npm http 304 https://registry.npmjs.org/through
npm http 304 https://registry.npmjs.org/mute-stream/0.0.4
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/stream-combiner
npm http GET https://registry.npmjs.org/tempfile
npm http GET https://registry.npmjs.org/adm-zip
npm http GET https://registry.npmjs.org/mout
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 GET https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/readable-stream
npm http GET https://registry.npmjs.org/xtend
npm http 304 https://registry.npmjs.org/es5-ext
npm http 304 https://registry.npmjs.org/memoizee
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/argparse
npm http 304 https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/CSSselect
npm http GET https://registry.npmjs.org/entities
npm http 304 https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/htmlparser2
npm http 304 https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/stream-combiner
npm http 304 https://registry.npmjs.org/tempfile
npm http 304 https://registry.npmjs.org/mout
npm http 304 https://registry.npmjs.org/adm-zip
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/punycode
npm http GET https://registry.npmjs.org/uuid
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/duplexer
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/readable-stream
npm http 304 https://registry.npmjs.org/xtend
npm http 304 https://registry.npmjs.org/CSSselect
npm http GET https://registry.npmjs.org/event-emitter
npm http GET https://registry.npmjs.org/next-tick
npm http GET https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/entities
npm http 304 https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/object-keys
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/htmlparser2
npm http 304 https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/punycode
npm http 304 https://registry.npmjs.org/hoek
npm http 304 https://registry.npmjs.org/cryptiles
npm WARN package.json punycode@1.2.3 No README.md file found!
npm http 304 https://registry.npmjs.org/uuid
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/duplexer
npm http 304 https://registry.npmjs.org/event-emitter
npm http 304 https://registry.npmjs.org/next-tick
npm http 304 https://registry.npmjs.org/object-keys
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/domhandler
npm http GET https://registry.npmjs.org/domutils
npm http GET https://registry.npmjs.org/domelementtype
npm http GET https://registry.npmjs.org/CSSwhat
npm http 304 https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/domhandler
npm http 304 https://registry.npmjs.org/domutils
npm http 304 https://registry.npmjs.org/domelementtype
npm http 304 https://registry.npmjs.org/CSSwhat
npm http GET https://registry.npmjs.org/core-util-is
npm http GET https://registry.npmjs.org/debuglog/0.0.2
npm http 304 https://registry.npmjs.org/core-util-is
npm http 304 https://registry.npmjs.org/debuglog/0.0.2
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js

> yo@1.1.2 postinstall /usr/local/lib/node_modules/yo
> node ./scripts/doctor

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! yo@1.1.2 postinstall: `node ./scripts/doctor`
npm ERR! `sh "-c" "node ./scripts/doctor"` failed with 127
npm ERR!
npm ERR! Failed at the yo@1.1.2 postinstall script.
npm ERR! This is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./scripts/doctor
npm ERR! You can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "yo" "-g"
npm ERR! cwd /home/harsha
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/harsha/npm-debug.log
npm ERR! not ok code 0

编辑

尝试 MortezaLSC 的解决方案后——我收到以下错误

npm http 304 https://registry.npmjs.org/amdefine
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js

> yo@1.1.2 postinstall /usr/local/lib/node_modules/yo
> node ./scripts/doctor

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! yo@1.1.2 postinstall: `node ./scripts/doctor`
npm ERR! `sh "-c" "node ./scripts/doctor"` failed with 127
npm ERR!
npm ERR! Failed at the yo@1.1.2 postinstall script.
npm ERR! This is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./scripts/doctor
npm ERR! You can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo" "grunt-cli" "bower"
npm ERR! cwd /usr/local/share
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/share/npm-debug.log
npm ERR! not ok code 0

最佳答案

我在 Ubuntu 12.04 和 CentOS 6 上都遇到了各种类似的问题。我在这两个系统上都运行了最新版本的 npm,但运气不好 - 有很多错误。

经过多次谷歌搜索、apt-getting 和 yumming,我终于想到升级节点本身。看这个answer on upgrading ,即:

sudo npm install n -g
sudo n stable

之后我回到:

sudo npm install -g yo

而且它在两个操作系统上都安装得很好!

好吧,在 CentOS 上我也必须转到我的主目录并执行:

sudo chmod -R myusername .npm

(.npm 及其下的所有内容都归 root 所有,在运行 yo generators 时造成麻烦)。

关于ubuntu - 在 ubuntu 上安装 Yeoman 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21656129/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com