2015-05-21 42 views
0

我試圖用consolidate包使用gulp來構建MEAN棧應用程序。但我不知道爲什麼,當我運行npm install,然後gulp browserify,它總是扔了很多例外情況,像使用合併節點程序包時的錯誤

Browserify Error { [Error: Cannot find module 'hogan.js' from '<my project path>\node_modules\consolidate\lib'] 
    stream: 
    { _readableState: 
     { highWaterMark: 16, 
     buffer: [], 
     length: 0, 
     pipes: [Object], 
     pipesCount: 1, 
     flowing: true, 
     ended: false, 
     endEmitted: false, 
     reading: true, 
     sync: false, 
     needReadable: true, 
     emittedReadable: false, 
     readableListening: false, 
     objectMode: true, 
     defaultEncoding: 'utf8', 
     ranOut: false, 
     awaitDrain: 0, 
     readingMore: false, 
     decoder: null, 
     encoding: null, 
     resumeScheduled: false }, 
    readable: true, 
    domain: null, 
    _events: 
     { end: [Object], 
     error: [Object], 
     data: [Function: ondata], 
     _mutate: [Object] }, 
    _maxListeners: undefined, 
    _writableState: 
     { highWaterMark: 16, 
     objectMode: true, 
     needDrain: false, 
     ending: true, 
     ended: true, 
     finished: true, 
     decodeStrings: true, 
     defaultEncoding: 'utf8', 
     length: 0, 
     writing: false, 
     corked: 0, 
     sync: false, 
     bufferProcessing: false, 
     onwrite: [Function], 
     writecb: null, 
     writelen: 0, 
     buffer: [], 
     pendingcb: 0, 
     prefinished: true, 
     errorEmitted: false }, 
    writable: true, 
    allowHalfOpen: true, 
    _options: { objectMode: true }, 
    _wrapOptions: { objectMode: true }, 
    _streams: [ [Object], [Object] ], 
    length: 2, 
    label: 'deps' } } 
[16:01:17] Browserify Error { [Error: Cannot find module 'handlebars' from '<my project path>\node_modules\consolidate\lib'] 
    stream: 
    { _readableState: 
     { highWaterMark: 16, 
     buffer: [], 
     length: 0, 
     pipes: [Object], 
     pipesCount: 1, 
     flowing: true, 
     ended: false, 
     endEmitted: false, 
     reading: true, 
     sync: false, 
     needReadable: true, 
     emittedReadable: false, 
     readableListening: false, 
     objectMode: true, 
     defaultEncoding: 'utf8', 
     ranOut: false, 
     awaitDrain: 0, 
     readingMore: false, 
     decoder: null, 
     encoding: null, 
     resumeScheduled: false }, 
    readable: true, 
    domain: null, 
    _events: 
     { end: [Object], 
     error: [Object], 
     data: [Function: ondata], 
     _mutate: [Object] }, 
    _maxListeners: undefined, 
    _writableState: 
     { highWaterMark: 16, 
     objectMode: true, 
     needDrain: false, 
     ending: true, 
     ended: true, 
     finished: true, 
     decodeStrings: true, 
     defaultEncoding: 'utf8', 
     length: 0, 
     writing: false, 
     corked: 0, 
     sync: false, 
     bufferProcessing: false, 
     onwrite: [Function], 
     writecb: null, 
     writelen: 0, 
     buffer: [], 
     pendingcb: 0, 
     prefinished: true, 
     errorEmitted: false }, 
    writable: true, 
    allowHalfOpen: true, 
    _options: { objectMode: true }, 
    _wrapOptions: { objectMode: true }, 
    _streams: [ [Object], [Object] ], 
    length: 2, 
    label: 'deps' } } 
[16:01:17] Browserify Error { [Error: Cannot find module 'underscore' from '<my project path>\node_modules\consolidate\lib'] 

我想這事錯在鞏固包,因爲它沒有遞歸安裝包。我使用的合併版本是0.12.1。任何人都可以幫助我?

+0

您是否安裝了引發錯誤的軟件包? –

+0

@BenFortune實際上,並沒有成功安裝所有軟件包。它只在我運行'gulp browserify'時拋出錯誤。我試圖'cd'進入該模塊,然後手動運行'npm install',然後我可以克服這些錯誤。不知道發生了什麼? – thangchung

回答

0

Consolidate不包含任何模板引擎。你應該在你的關卡上安裝它們。

我猜你正在使用hogan模板,所以你需要安裝它。在您的項目根目錄中運行此項

npm install hogan.js --save