【问题标题】:webpack compile gives ts-loader error on new computerwebpack compile 在新计算机上给出 ts-loader 错误
【发布时间】:2020-08-21 13:51:27
【问题描述】:

我刚刚安装了一台新笔记本电脑,检查了我的源代码,按标准运行 npm install。然后运行 ​​webpack 构建:

npm run clean && npm run scss && webpack --bail --progress --profile

然后我得到这个错误,我无法在任何地方找到详细信息。我已经删除了 node_modules 并再次重新运行 npm install 但仍然遇到同样的问题。我束手无策......知道我能做些什么来解决这个问题吗?

ERROR in ./src/main/webapp/admin/main.ts
Module build failed (from ./node_modules/ts-loader/index.js):
\node_modules\ts-loader\node_modules\micromatch\index.js:44
    let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
                                                   ^^^
SyntaxError: Unexpected token ...
    at NativeCompileCache._moduleCompile (E:\mydirs\node_modules\v8-compile-cache\v8-compile-cache.js:240:18)
    at Module._compile (E:\mydirs\node_modules\v8-compile-cache\v8-compile-cache.js:186:36)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)`

我正在使用 typescript 2.7.2、节点 6.11.0 和 npm 3.10.10

【问题讨论】:

    标签: typescript npm webpack npm-install npm-start


    【解决方案1】:

    我升级到节点 10,删除了 node_modules 再次运行 npm install 现在一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-03
      • 2017-05-27
      • 2016-06-29
      • 2021-05-05
      • 1970-01-01
      • 1970-01-01
      • 2021-06-26
      相关资源
      最近更新 更多