Yo角度生成错误

时间:2014-12-17 23:23:02

标签: angularjs node.js npm bower yo

我在ubuntu 14.04上按源代码安装了nodejs和npm。

root@wemet:~/ang# npm version
{ http_parser: '1.0',
node: '0.10.34',
v8: '3.14.5.9',
ares: '1.9.0-DEV',
uv: '0.10.30',
zlib: '1.2.8',
modules: '11',
openssl: '1.0.1j',
npm: '1.4.28' }

我安装了yo和generate-angular作为全局这是我对本地的完整包安装: https://gist.github.com/thinksource/ba33f0cad073f3d4dc46

当我想要做的时候:

root@wemet:~/ang# yo angular

module.js:340
    throw err;
      ^
Error: Cannot find module '../../string/is-string'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/insight/n
ode_m odules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim
.js:9:22)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

我不知道什么是is-string模块。我在https://www.npmjs.com/查看,但找不到。

当我运行bower缓存时:

root@wemet:~/ang# npm i make-iterator --save-dev
info trying registry request attempt 1 at 00:21:04
http GET https://registry.npmjs.org/make-iterator
http 200 https://registry.npmjs.org/make-iterator
info trying registry request attempt 1 at 00:21:04
http GET https://registry.npmjs.org/for-own
http 200 https://registry.npmjs.org/for-own
info trying registry request attempt 1 at 00:21:05
http GET https://registry.npmjs.org/for-in
http 200 https://registry.npmjs.org/for-in
make-iterator@0.1.1 node_modules/make-iterator
└── for-own@0.1.2 (for-in@0.1.3)
root@wemet:~/ang# bower cache clean

module.js:340
throw err;
      ^
Error: Cannot find module '../function/makeIterator_'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/node_modules/mout/
rray/collect.js:2:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

我找到了模块make-iterator,但即使我安装了make-iterator,当我运行bower cache clean时仍然遇到错误。

2 个答案:

答案 0 :(得分:0)

我遇到了问题,我需要将我的npm版本从1.4.28升级到2.1.2。 谢谢你的关注。

答案 1 :(得分:0)

@user504909的回答将解决问题良好解决方案是将Nodejs版本从0.10.34升级到0.12.0作为升级的结果{ {1}}版本,Nodejs版本也会从npm升级到1.4.28

根据nodesource Blog升级2.1.2版本:

Nodejs

有关# Note the new setup script name for Node.js v0.12 curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - # Then install with: sudo apt-get install -y nodejs 操作系统的升级Nodejs版本的答案 - &gt; See This Link