taro编译到微信小程序报错



  • Cannot read property 'hooks' of undefined

    (node:4800) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hooks' of undefined
    at Watching.handler (E:\project\taro\surveyTaro\node_modules@tarojs\mini-runner\dist\index.js:49:33)
    at E:\project\taro\surveyTaro\node_modules@tarojs\mini-runner\node_modules\webpack\lib\Watching.js:99:9
    at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\project\taro\surveyTaro\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:22:1)
    at AsyncSeriesHook.lazyCompileHook (E:\project\taro\surveyTaro\node_modules\tapable\lib\Hook.js:154:20)
    at Watching._done (E:\project\taro\surveyTaro\node_modules@tarojs\mini-runner\node_modules\webpack\lib\Watching.js:98:28)
    at E:\project\taro\surveyTaro\node_modules@tarojs\mini-runner\node_modules\webpack\lib\Watching.js:73:19
    at Compiler.emitRecords (E:\project\taro\surveyTaro\node_modules@tarojs\mini-runner\node_modules\webpack\lib\Compiler.js:499:39)
    at E:\project\taro\surveyTaro\node_modules@tarojs\mini-runner\node_modules\webpack\lib\Watching.js:54:20
    at E:\project\taro\surveyTaro\node_modules@tarojs\mini-runner\node_modules\webpack\lib\Compiler.js:485:14
    at eval (eval at create (E:\project\taro\surveyTaro\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:10:1)
    at MiniPlugin.<anonymous> (E:\project\taro\surveyTaro\node_modules@tarojs\mini-runner\dist\plugins\MiniPlugin.js:101:17)
    at Generator.next (<anonymous>)
    at fulfilled (E:\project\taro\surveyTaro\node_modules@tarojs\mini-runner\dist\plugins\MiniPlugin.js:5:58)
    (node:4800) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
    (node:4800) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    Done in 44.45s.



  • 你好,请问解决了吗?我也遇到这个问题了



  • 全局的 @taro/cli 卸载重新安装(需要与项目的 @taro/cli 的版本一致)



  • @jd_44789641df499 全局的 @taro/cli 卸载重新安装(需要与项目的 @taro/cli 的版本一致)



  • 这是 taro 升级后可能遇到的问题,升级npm ,后绑定就好了 ,命令npm update ,后npm rebuild node-sass


登录后回复