0

Why compiling directly with cd src/Front && tsc shows the following error messages when running while with npm run build there is none?

$ (cd src/Front/ && tsc)

SearchProgressResultsDownload.ts:128:25 - error TS2495: Type 'HTMLCollectionOf<HTMLTableRowElement>' is not an array type or a string type.

128       for( const row of this.tbody.rows ) {
                            ~~~~~~~~~~~~~~~

tsconfig.json:4:24 - error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'esnext'.

4       "target"       : "ES2022",
                         ~~~~~~~~

tsconfig.json:5:24 - error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'esnext'.

5       "module"       : "ES2022",
                         ~~~~~~~~


Found 3 errors.

Here is package.json:

{
   "name": "amule",
   "version": "1.0.0",
   "description": "Node JS App wrapping amulecmd",
   "main": "dist/server.js",
   "scripts": {
      "lint": "eslint -c .eslintrc --ext .ts ./src",
      "build": "(cd src/Front && tsc)",
   },
   "keywords": [
      "aMule"
   ],
   "author": "",
   "license": "LGPL",
   "devDependencies": {
      "@types/mime-types": "^2.1.1",
      "@types/node": "^18.11.18",
      "@typescript-eslint/eslint-plugin": "^5.49.0",
      "eslint": "^8.33.0",
      "mime-types": "^2.1.35",
      "ts-node": "^10.9.1",
      "typescript": "^4.9.4"
   },
   "dependencies": {
      "bootstrap": "^5.2.3"
   }
}

Here is tsconfig.json:

{
   "compilerOptions": {
      "sourceMap"    : true,
      "target"       : "ES2022",
      "module"       : "ES2022",
      "alwaysStrict" : true,
      "noImplicitAny": true,
      "outDir"       : "../../dist",
      "moduleResolution": "node"
   },
   "exclude": [
      "../Back/"
   ],
   "include": [
      "../Types/*",
      "./*"
   ]
}

How can I have the same production as npm run build directly with tsc?

Aubin
  • 14,617
  • 9
  • 61
  • 84

0 Answers0