taro编译没问题,但是监听文件修改报错?



  • ✅ 编译成功,请打开微信小程序开发者工具进行查看

    监听文件修改中...

    Cannot read property 'hooks' of undefined

    Cannot read property 'hooks' of undefined

    (node:13008) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hooks' of undefined
    at Watching.handler (D:\x-20200623\startupServicePlatform\node_modules_@tarojs_mini-runner@2.1.0@@tarojs\mini-runner\dist\index.js:50:33)
    at D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Watching.js:99:9
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\x-20200623\startupServicePlatform\node_modules_tapable@1.1.3@tapable\lib\HookCodeFactory.js:33:10), <anonymous>:24:1)
    at AsyncSeriesHook.lazyCompileHook (D:\x-20200623\startupServicePlatform\node_modules_tapable@1.1.3@tapable\lib\Hook.js:154:20)
    at Watching._done (D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Watching.js:98:28)
    at D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Watching.js:73:19
    at Compiler.emitRecords (D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Compiler.js:499:39)
    at D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Watching.js:54:20
    at D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Compiler.js:485:14
    at eval (eval at create (D:\x-20200623\startupServicePlatform\node_modules_tapable@1.1.3@tapable\lib\HookCodeFactory.js:33:10), <anonymous>:11:1)
    at MiniPlugin.<anonymous> (D:\x-20200623\startupServicePlatform\node_modules_@tarojs_mini-runner@2.1.0@@tarojs\mini-runner\dist\plugins\MiniPlugin.js:107:17)
    at Generator.next (<anonymous>)
    at fulfilled (D:\x-20200623\startupServicePlatform\node_modules_@tarojs_mini-runner@2.1.0@@tarojs\mini-runner\dist\plugins\MiniPlugin.js:5:58)
    (Use node --trace-warnings ... to show where the warning was created)
    (node:13008) 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:13008) [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.



  • 因为使用cnpm之后无法自动全部装完,总是卡住,所以插件是我一个一个装的,然后就出了这个问题。



  • 382ae377-89da-4dd9-a35b-6061a40319dd-image.png
    刚才我也出现这个问题

    我通过 npm update 和 npm install 之后解决了。
    583d1755-a75d-49a4-b665-3238642af92b-image.png


登录后回复