2016-10-24 15 views
2

我試圖在我的源代碼目錄中運行gulp serve。 該命令加載所有文件並開始使用我的gulpfile.jsgulp.js中的錯誤

至於結果,我有以下錯誤:

gulpInst.start.apply(gulpInst, toRun); 
      ^

TypeError: Cannot read property 'apply' of undefined at C:\Users...\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:19 at nextTickCallbackWith0Args (node.js:420:9) at process._tickCallback (node.js:349:13) at Function.Module.runMain (module.js:443:11) at startup (node.js:139:18) at node.js:974:3

gulpfile.js第一行是:

const gulp = require('gulp'); 

這是我與node.js的第一次的經驗和吞掉了。我需要從源頭啓動現有應用程序,對於我來說,這個錯誤消息看起來像框架中發現的框架中的錯誤。我覺得我做錯了什麼,但不知道是什麼?我該如何解決這個問題?

+1

什麼是'gulpInst'? – Weedoze

+0

'var gulpInst = require(env.modulePath);' - from bin \ gulp.js –

回答

2

嘗試重新安裝一口-CLI:

npm install -g gulp-cli