java,typescript 基础 angular 项目 parser.js 错误
java, typescript base angular project parser.js error
我正在使用基于 java 的 angular2 项目。
使用以下 maven 插件 sonarcube version 6.7.1
org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603
我已经为 .js 和 .js.map 文件添加了排除项,如下所示。
<sonar.excludes>**/*.js,**/js.map,**/node_modules</sonar.excludes>
当我 运行 我的项目时,我可以在日志中看到这些文件已标记为排除项。
在日志中我看到以下错误,然后是构建成功
[INFO] Sensor TypeScript Sensor [typescript]
[ERROR] /Users/user1/abc/web/target/sonar/sonarts-bundle/node_modules/tslint-sonarts/lib/utils/parser.js:30
[ERROR] function parseString(source, scriptKind = ts.ScriptKind.TSX) {
[ERROR] ^
[ERROR]
[ERROR] SyntaxError: Unexpected token =
[ERROR] at exports.runInThisContext (vm.js:53:16)
[ERROR] at Module._compile (module.js:373:25)
[ERROR] at Object.Module._extensions..js (module.js:416:10)
[ERROR] at Module.load (module.js:343:32)
[ERROR] at Function.Module._load (module.js:300:12)
[ERROR] at Module.require (module.js:353:17)
[ERROR] at require (internal/module.js:12:17)
[ERROR] at Object.<anonymous> (/Users/user1/abc/web/target/sonar/sonarts-bundle/node_modules/tslint-sonarts/lib/runner/tsrunner.js:24:18)
[ERROR] at Module._compile (module.js:409:26)
[ERROR] at Object.Module._extensions..js (module.js:416:10)
[ERROR] External process `node /Users/user1/abc/web/target/sonar/sonarts-bundle/node_modules/tslint-sonarts/bin/tsrunner` returned an empty output. Run with -X for more information
即使构建成功,但仍然想知道为什么会出现此错误。
您可能有一些没有排除的 TypeScript 文件。他们的存在启动了需要 Nodejs >=6.
的 TypeScript 传感器
因此您也应该排除 TypeScript 文件或更新您的节点
我正在使用基于 java 的 angular2 项目。
使用以下 maven 插件 sonarcube version 6.7.1
org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603
我已经为 .js 和 .js.map 文件添加了排除项,如下所示。
<sonar.excludes>**/*.js,**/js.map,**/node_modules</sonar.excludes>
当我 运行 我的项目时,我可以在日志中看到这些文件已标记为排除项。
在日志中我看到以下错误,然后是构建成功
[INFO] Sensor TypeScript Sensor [typescript]
[ERROR] /Users/user1/abc/web/target/sonar/sonarts-bundle/node_modules/tslint-sonarts/lib/utils/parser.js:30
[ERROR] function parseString(source, scriptKind = ts.ScriptKind.TSX) {
[ERROR] ^
[ERROR]
[ERROR] SyntaxError: Unexpected token =
[ERROR] at exports.runInThisContext (vm.js:53:16)
[ERROR] at Module._compile (module.js:373:25)
[ERROR] at Object.Module._extensions..js (module.js:416:10)
[ERROR] at Module.load (module.js:343:32)
[ERROR] at Function.Module._load (module.js:300:12)
[ERROR] at Module.require (module.js:353:17)
[ERROR] at require (internal/module.js:12:17)
[ERROR] at Object.<anonymous> (/Users/user1/abc/web/target/sonar/sonarts-bundle/node_modules/tslint-sonarts/lib/runner/tsrunner.js:24:18)
[ERROR] at Module._compile (module.js:409:26)
[ERROR] at Object.Module._extensions..js (module.js:416:10)
[ERROR] External process `node /Users/user1/abc/web/target/sonar/sonarts-bundle/node_modules/tslint-sonarts/bin/tsrunner` returned an empty output. Run with -X for more information
即使构建成功,但仍然想知道为什么会出现此错误。
您可能有一些没有排除的 TypeScript 文件。他们的存在启动了需要 Nodejs >=6.
的 TypeScript 传感器因此您也应该排除 TypeScript 文件或更新您的节点