【问题标题】:ERROR npm failed with exit code 2 Error: Command failed: node_modules/.bin/vsce package --no-yarn错误 npm failed with exit code 2 错误:命令失败:node_modules/.bin/vsce package --no-yarn
【发布时间】:2021-07-29 11:00:29
【问题描述】:

这是 cmd 中显示的确切错误

  TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'.

ERROR npm 失败,退出代码为 2 错误:命令失败:node_modules/.bin/vsce package --no-yarn

 at Object.execSync (child_process.js:652:15)
 at CodeUtil.packageExtension (/home/.../out/util/codeUtil.js:180:23)
 at ExTester.<anonymous> (/home/.../out/extester.js:77:27)
 at Generator.next (<anonymous>)
 at /home/.../out/extester.js:18:71
 at new Promise (<anonymous>)
 at __awaiter (/home/.../out/extester.js:14:12)
 at ExTester.installVsix (/home/.../out/extester.js:58:16)
 at ExTester.<anonymous> (/home/.../out/extester.js:112:24)```

'module' flag is already set to 'commonjs' and 'target' is set to 'es6'

【问题讨论】:

    标签: node.js typescript npm yarnpkg vscode-extensions


    【解决方案1】:

    现在解决了。 需要在tsconfig.json中添加“test-resources”>“exclude”

    【讨论】:

      猜你喜欢
      • 2020-05-01
      • 1970-01-01
      • 2022-01-02
      • 2017-10-29
      • 2019-04-03
      • 2016-01-03
      • 1970-01-01
      • 2022-12-01
      • 1970-01-01
      相关资源
      最近更新 更多