2013-12-20 49 views
0

我有時間調試這個錯誤 - 尋找另一組眼睛。Yeoman發生器錯誤this.log = this.env.adapter.log;

我分叉羅曼·伯傑的約曼WordPress的發電機來修改我的工作流程,github上回購在這裏: https://github.com/mykepreuss/yeoman-wordpress

NPM鏈接到我的發電機在這裏: https://npmjs.org/package/generator-assembly-wp

後,我安裝並運行:yo assembly-wp我收到以下錯誤:

/usr/local/lib/node_modules/generator-assembly-wp/node_modules/yeoman-generator/lib/base.js:79 
    this.log = this.env.adapter.log; 
          ^
TypeError: Cannot read property 'log' of undefined 
    at Generator.Base (/usr/local/lib/node_modules/generator-assembly-wp/node_modules/yeoman-generator/lib/base.js:79:30) 
    at new Generator (/usr/local/lib/node_modules/generator-assembly-wp/app/index.js:17:26) 
    at Environment.create (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index.js:325:10) 
    at Environment.run (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index.js:361:24) 
    at init (/usr/local/lib/node_modules/yo/cli.js:95:7) 
    at pre (/usr/local/lib/node_modules/yo/cli.js:108:3) 
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/cli.js:134:1) 
    at Module._compile (module.js:456:26) 
    at Object.Module._extensions..js (module.js:474:10) 
    at Module.load (module.js:356:32) 

任何幫助將不勝感激!

回答

1

這是因爲您使用Generator系統0.15(不在穩定版本中)與yo 1.0.6。

要麼運行你的發電機0.14和yo 1.0.6。或0.15.0-pre.1和yo 1.0.7-pre.1

運行發電機(順便說一句,錯誤注意到並還會有正式全面發佈之前修復)

+0

我在哪裏看對於發電機系統版本@ simon-boudrias - 感謝您的幫助,想知道您的故障排除方法。 –

+0

與每個node.js模塊一樣,在'package.json'文件中。對於'yo',因爲它是一個全局包,只需運行'npm ls -g --depth = 0'並檢查它給你的版本。要安裝最新版本,只需運行'npm install @'。 –

+0

好的,我看@ @ simon-boudrias - 謝謝你,我對此一無所知。非常感激! –