意外令牌 { ../node_modules/fs-extra/lib/mkdirs/make-dir.js:85 } catch {

tg_*_*non 20 amazon-web-services node.js node-modules aws-cdk docsy

我在构建我的应用程序时遇到了这个问题 -

2020-07-12 16:48:39 ....: 
                   ^
SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)..


   
                        BUILD FAILED 
Run Code Online (Sandbox Code Playgroud)

语法错误:意外标记 {

我无法理解是什么导致了它。我正在尝试将代码从 cfn 迁移到 cdk。请帮我解决这个问题。

小智 33

从 GitHub 上查看此线程:https : //github.com/google/docsy/issues/265 基本上,您需要做的是将节点版本升级到 10.0.0 或更高版本并将 fs-extra 包更新到 9.0。 0 或更高。对我来说,它只是与 node.js 的更新一起工作。