0

执行此命令后:

yo angular angular-app

我收到此错误消息:

/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:84
  if (_.isString(componentConfigFile.main)) {
                                    ^
TypeError: Cannot read property 'main' of undefined
    at findMainFiles (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:84:37)
    at /usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:146:17
    at forOwn (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/lodash/dist/lodash.js:1301:15)
    at Function.forEach (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/lodash/dist/lodash.js:2595:9)
    at detectDependencies (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:28:5)
    at wiredep (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/wiredep.js:57:39)
    at Generator._injectDependencies (/usr/local/lib/node_modules/generator-angular/app/index.js:326:5)
    at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:232:13
    at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:113:21
    at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:24:16

我正在使用 Ubuntu 14.04。任何人都可以帮忙吗?

4

1 回答 1

0

我不确定是什么情况,但是在使用以下命令后,我能够很好地运行它。

sudo npm 缓存清理

Ps.:您可能需要删除创建文件,运行上面的命令,然后尝试再次执行 yo angular。

于 2014-08-17T13:07:24.897 回答