升级到Mojave,现在Webpack构建失败

时间:2018-09-25 17:44:47

标签: javascript node.js npm webpack handlebars.js

升级到Mojave后,在我的项目上运行webpack --mode development现在会出现以下错误:

ERROR in ./src/templates/contact-list-item.hbs
Module build failed (from ./node_modules/handlebars-loader/index.js):
/Users/username/Desktop/Project/Public/js/node_modules/loader-utils/lib/urlToRequest.js:7
    const moduleRequestRegex = /^[^?]*../../;
                                          ^

我的每个.hbs文件都重复此错误。

我不确定这是npm问题还是webpack问题。我想知道安装MacOS Mojave的方式可能会有所改变,从而打破这一点。如果有人有任何想法,我将不胜感激! :)

完整堆栈跟踪

SyntaxError: Unexpected token .
at new Script (vm.js:74:7)
at NativeCompileCache._moduleCompile (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:226:18)
at Module._compile (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:172:36)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/Users/sammettam/Desktop/Vapor3Test/Public/js/node_modules/loader-utils/lib/index.js:8:22)
at Module._compile (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/Users/sammettam/Desktop/Vapor3Test/Public/js/node_modules/handlebars-loader/index.js:1:81)
at Module._compile (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at loadLoader (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loadLoader.js:13:17)
at iteratePitchingLoaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
at runLoaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
at NormalModule.doBuild (/usr/local/lib/node_modules/webpack/lib/NormalModule.js:265:3)
at NormalModule.build (/usr/local/lib/node_modules/webpack/lib/NormalModule.js:412:15)
@ ./src/features/contacts/contact-form.js 7:0-65 62:17-37
@ ./src/components/create-menu.js
@ ./src/app.js

0 个答案:

没有答案