Base solution for your next web application
Open Closed

Error in non-existent folder #10853


User avatar
0
timmackey created

ANZ 8.4.0 Angular/.net core

npm start on version 8.4.0 produces the following error:


C:\Users\Tim\Documents\__ngTTMv840\ngTTM\angular>npm start

> [email protected] start
> gulp buildDev && ng serve --host 0.0.0.0 --port 4200

[21:51:31] Using gulpfile ~\Documents\__ngTTMv840\ngTTM\angular\gulpfile.js
[21:51:31] Starting 'buildDev'...
Dynamic bundles are being created.
[21:51:48] Finished 'buildDev' after 17 s
WARNING: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.

Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disableHostCheck" if that's the
case.
10% building 4/4 modules 0 activei 「wds」: Project is running at http://0.0.0.0:4200/webpack-dev-server/
i 「wds」: webpack output is served from /
i 「wds」: 404s will fallback to //index.html

chunk {main} main.js, main.js.map (main) 2.03 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 154 kB [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 554 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 2.37 MB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 3.56 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 347 kB [initial] [rendered]
Date: 2022-01-28T05:52:19.158Z - Hash: 81891f0cb666755672d2 - Time: 20841ms

v: '{' or ';' expected.

2     function assert(value: any, message?: string | Error): asserts value;
                                                                     ~~~~~
../node_modules/@types/node/assert.d.ts:53:68 - error TS1144: '{' or ';' expected.

53         function ok(value: any, message?: string | Error): asserts value;
                                                                      ~~~~~
../node_modules/@types/node/assert.d.ts:62:94 - error TS1144: '{' or ';' expected.

62         function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
                                                                                                ~~~~~~
../node_modules/@types/node/assert.d.ts:62:101 - error TS1005: ';' expected.

62         function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
                                                                                                       ~~
../node_modules/@types/node/assert.d.ts:62:104 - error TS1005: ';' expected.

62         function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
                                                                                                          ~
../node_modules/@types/node/assert.d.ts:64:98 - error TS1144: '{' or ';' expected.

64         function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
                                                                                                    ~~~~~~
../node_modules/@types/node/assert.d.ts:64:105 - error TS1005: ';' expected.

64         function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
                                                                                                           ~~
../node_modules/@types/node/assert.d.ts:64:108 - error TS1005: ';' expected.

64         function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
                                                                                                              ~
../node_modules/@types/node/assert.d.ts:72:47 - error TS1144: '{' or ';' expected.

72         function ifError(value: any): asserts value is null | undefined;
                                                 ~~~~~
../node_modules/@types/node/assert.d.ts:72:53 - error TS1005: ';' expected.

72         function ifError(value: any): asserts value is null | undefined;
                                                       ~~
../node_modules/@types/node/assert.d.ts:72:56 - error TS1005: ';' expected.

72         function ifError(value: any): asserts value is null | undefined;
                                                          ~~~~
../node_modules/@types/node/assert.d.ts:99:61 - error TS1005: ';' expected.

99             (value: any, message?: string | Error): asserts value;
                                                               ~~~~~

** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on http://localhost:4200/ **
i 「wdm」: Failed to compile.

The most puzzling aspect of this error report is the reference to ../node_modules/@types/node/assert.d.ts. There is no such folder.

package.json

{
  "name": "abp-zero-template",
  "version": "8.4.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "ng": "ng",
    "publish": "gulp build && ng build --prod",
    "start": "gulp buildDev && ng serve --host 0.0.0.0 --port 4200",
    "hmr": "gulp buildDev && ng serve --host 0.0.0.0 --port 4200 --hmr",
    "test": "gulp buildDev && ng test",
    "pree2e": "webdriver-manager update --standalone false --gecko false",
    "e2e": "gulp buildDev && protractor",
    "create-dynamic-bundles": "gulp buildDev",
    "nswag": "cd nswag/ && refresh.bat"
  },
  "private": false,
  "dependencies": {
    "@angular/animations": "^8.2.5",
    "@angular/cdk": "^8.1.4",
    "@angular/common": "^8.2.5",
    "@angular/compiler": "^8.2.5",
    "@angular/core": "^8.2.5",
    "@angular/forms": "^8.2.5",
    "@angular/platform-browser": "^8.2.5",
    "@angular/platform-browser-dynamic": "^8.2.5",
    "@angular/platform-server": "^8.2.5",
    "@angular/router": "^8.2.5",
    "@fortawesome/fontawesome-pro": "^5.15.1",
    "@microsoft/signalr": "^3.1.2",
    "@ng-bootstrap/ng-bootstrap": "^5.1.4",
    "@nth-cloud/ng-toggle": "6.0.0",
    "@swimlane/ngx-charts": "^12.0.1",
    "@types/bootstrap": "^4.3.1",
    "@types/dwt": "^15.2.3",
    "@types/moment": "^2.13.0",
    "abp-ng2-module": "^5.1.0",
    "abp-web-resources": "^4.2.0",
    "adal-angular": "^1.0.17",
    "angular-gridster2": "^8.2.0",
    "angular-oauth2-oidc": "^8.0.4",
    "angular-resizable-element": "3.2.2",
    "angular-resize-event": "^1.1.1",
    "angular2-counto": "^1.2.5",
    "angular2-text-mask": "^9.0.0",
    "animate.css": "^3.7.2",
    "body-scroll-lock": "^3.0.2",
    "ckeditor4-angular": "^2.2.2",
    "cookieconsent": "^3.1.1",
    "core-js": "^3.3.3",
    "dwt": "15.3",
    "famfamfam-flags": "^1.0.0",
    "file-saver": "^2.0.2",
    "js-cookie": "^2.2.1",
    "just-compare": "^1.3.0",
    "localforage": "^1.7.3",
    "lodash": "^4.17.13",
    "mathjax": "^3.2.0",
    "mathjax-server": "^1.3.1",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.27",
    "msal": "^1.2.1",
    "ng-recaptcha": "^5.0.0",
    "ng2-file-upload": "^1.4.0",
    "ngx-bootstrap": "^5.2.0",
    "ngx-drag-drop": "^2.0.0",
    "ngx-filesaver": "^8.1.0",
    "ngx-image-cropper": "^1.5.1",
    "ngx-perfect-scrollbar": "^8.0.0",
    "ngx-spinner": "^8.0.3",
    "object-path": "^0.11.4",
    "primeflex": "^3.1.2",
    "primeicons": "^2.0.0",
    "primeng": "8.0.3",
    "push.js": "^1.0.12",
    "quill": "^1.3.7",
    "rtl-detect": "^1.0.2",
    "rxjs": "^6.5.3",
    "simple-line-icons": "^2.4.1",
    "sweetalert2": "^8.18.6",
    "text-mask-addons": "^3.8.0",
    "typescript": "3.4.5",
    "typescript-string-operations": "^1.3.1",
    "webdriver-manager": "^12.1.7",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.3",
    "@angular/cli": "^8.3.3",
    "@angular/compiler-cli": "^8.2.5",
    "@angularclass/hmr": "^2.1.3",
    "@angularclass/hmr-loader": "^3.0.4",
    "@types/jasmine": "~3.4.0",
    "@types/jasminewd2": "^2.0.8",
    "@types/lodash": "^4.14.144",
    "@types/moment-timezone": "^0.5.12",
    "@types/node": "^12.11.6",
    "codelyzer": "^5.2.0",
    "gulp": "^4.0.1",
    "gulp-clean-css": "^4.2.0",
    "gulp-concat": "^2.6.1",
    "gulp-less": "^4.0.1",
    "gulp-postcss": "^8.0.0",
    "gulp-uglify": "^3.0.2",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "^4.4.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-cli": "~2.0.0",
    "karma-coverage-istanbul-reporter": "^2.1.0",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "merge-stream": "^2.0.0",
    "nswag": "13.0.6",
    "postcss-url": "^9.0.0",
    "protractor": "~5.4.2",
    "ts-node": "~8.3.0",
    "tslib": "1.10.0",
    "tslint": "~5.19.0",
    "typescript": "3.4.5"
  }
}

Why would npm report an error in a non-existent file in a non-existent folder?


8 Answer(s)
  • User Avatar
    0
    timmackey created

    angular.json

    {
      "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
      "version": 1,
      "newProjectRoot": "projects",
      "projects": {
        "abp-zero-template": {
          "root": "",
          "sourceRoot": "src",
          "projectType": "application",
          "architect": {
            "build": {
              "builder": "@angular-devkit/build-angular:browser",
              "options": {
                "outputPath": "dist",
                "index": "src/index.html",
                "main": "src/main.ts",
                "tsConfig": "src/tsconfig.json",
                "polyfills": "src/polyfills.ts",
                "preserveSymlinks": true,
                "assets": [
                  "src/assets",
                  "src/metronic",
                  "src/favicon.ico",
                  {
                    "glob": "abp.signalr-client.js",
                    "input": "node_modules/abp-web-resources/Abp/Framework/scripts/libs",
                    "output": "/assets/abp"
                    },
                    {
                        "glob": "**/*",
                        "input": "node_modules/@fortawesome",
                        "output": "/assets/@fortawesome"
                  }
                ],
                "styles": [
                  "node_modules/animate.css/animate.min.css",
                  "node_modules/quill/dist/quill.core.css",
                  "node_modules/quill/dist/quill.snow.css",
                  "node_modules/famfamfam-flags/dist/sprite/famfamfam-flags.css",
                  "node_modules/primeng/resources/primeng.min.css",
                  "node_modules/primeng/resources/themes/nova-light/theme.css",
                  "node_modules/primeicons/primeicons.css",
                  "node_modules/sweetalert2/dist/sweetalert2.css",
                  "node_modules/cookieconsent/build/cookieconsent.min.css",
                    "node_modules/primeflex/primeflex.css",
                  "src/assets/primeng/file-upload/css/primeng.file-upload.css",
                  "src/assets/primeng/autocomplete/css/primeng.autocomplete.css",
                  "src/assets/primeng/tree/css/primeng.tree.css",
                  "src/assets/primeng/context-menu/css/primeng.context-menu.css",
    
                  "src/assets/fonts/fonts-poppins.css",
                  "src/assets/fonts/fonts-roboto.css",
    
                  "src/assets/ngx-bootstrap/bs-datepicker.css",
    
                  "src/assets/metronic/vendors/global/vendors.bundle.css",
                    "node_modules/@fortawesome/fontawesome-pro/css/all.css",
                  "src/app/shared/core.less",
                  "src/app/shared/layout/layout.less",
                  "src/styles.css"
                ],
                "scripts": [
                  "node_modules/@microsoft/signalr/dist/browser/signalr.min.js",
                  "node_modules/localforage/dist/localforage.js",
                  "node_modules/moment/min/moment-with-locales.js",
                  "node_modules/moment-timezone/builds/moment-timezone-with-data.js",
                  "node_modules/push.js/bin/push.js",
                  "node_modules/quill/dist/quill.js",
                  "node_modules/sweetalert2/dist/sweetalert2.js",
                  "node_modules/cookieconsent/build/cookieconsent.min.js",
    
                  "src/assets/abp-web-resources/abp.js",
                  "src/assets/abp-web-resources/abp.sweet-alert.js",
                  "src/assets/abp-web-resources/abp.notify.js",
                  "src/assets/canvas-toBlob/canvas-toBlob.js",
                  "node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.moment.js",
    
                  "src/assets/metronic/vendors/global/vendors.bundle.js",
                  "src/assets/metronic/common/js/scripts.bundle.js",
    
                  "node_modules/dwt/dist/dynamsoft.webtwain.min.js"
                ]
              },
              "configurations": {
                "hmr": {
                  "fileReplacements": [
                    {
                      "replace": "src/environments/environment.ts",
                      "with": "src/environments/environment.hmr.ts"
                    }
                  ]
                },
                "production": {
                  "optimization": true,
                  "outputHashing": "all",
                  "sourceMap": false,
                  "extractCss": true,
                  "namedChunks": false,
                  "aot": true,
                  "extractLicenses": true,
                  "vendorChunk": false,
                  "buildOptimizer": true,
                  "fileReplacements": [
                    {
                      "replace": "src/environments/environment.ts",
                      "with": "src/environments/environment.prod.ts"
                    }
                  ]
                },
                "staging": {
                    "optimization": true,
                    "outputHashing": "all",
                    "sourceMap": false,
                    "extractCss": true,
                    "namedChunks": false,
                    "aot": true,
                    "extractLicenses": true,
                    "vendorChunk": false,
                    "buildOptimizer": true,
                    "fileReplacements": [
                        {
                            "replace": "src/environments/environment.ts",
                            "with": "src/environments/environment.stage.ts"
                        }
                    ]
                }
              }
            },
            "serve": {
              "builder": "@angular-devkit/build-angular:dev-server",
              "options": {
                "browserTarget": "abp-zero-template:build"
              },
              "configurations": {
                "hmr": {
                  "browserTarget": "abp-zero-template:build:hmr"
                },
                "production": {
                  "browserTarget": "abp-zero-template:build:production"
                }
              }
            },
            "extract-i18n": {
              "builder": "@angular-devkit/build-angular:extract-i18n",
              "options": {
                "browserTarget": "abp-zero-template:build"
              }
            },
            "test": {
              "builder": "@angular-devkit/build-angular:karma",
              "options": {
                "tsConfig": "src/tsconfig.json",
                "main": "src/test.ts",
                "karmaConfig": "./karma.conf.js",
                "polyfills": "src/polyfills.ts",
                "styles": [
                  "node_modules/animate.css/animate.min.css",
                  "node_modules/quill/dist/quill.core.css",
                  "node_modules/quill/dist/quill.snow.css",
                  "node_modules/famfamfam-flags/dist/sprite/famfamfam-flags.css",
                  "node_modules/primeng/resources/primeng.min.css",
                  "node_modules/primeng/resources/themes/nova-light/theme.css",
                  "node_modules/primeicons/primeicons.css",
                  "node_modules/sweetalert2/dist/sweetalert2.css",
                  "node_modules/cookieconsent/build/cookieconsent.min.css",
    
                  "src/assets/primeng/file-upload/css/primeng.file-upload.css",
                  "src/assets/primeng/autocomplete/css/primeng.autocomplete.css",
                  "src/assets/primeng/tree/css/primeng.tree.css",
                  "src/assets/primeng/context-menu/css/primeng.context-menu.css",
    
                  "src/assets/fonts/fonts-poppins.css",
                  "src/assets/fonts/fonts-roboto.css",
    
                  "src/assets/ngx-bootstrap/bs-datepicker.css",
    
                  "src/assets/metronic/vendors/global/vendors.bundle.css",
                  "src/assets/@fortawesome/fontawesome-pro/css/all.css",
                  
                  "src/app/shared/core.less",
                  "src/app/shared/layout/layout.less",
                  "src/styles.css"
                ],
                "scripts": [
                  "node_modules/@microsoft/signalr/dist/browser/signalr.min.js",
                  "node_modules/localforage/dist/localforage.js",
                  "node_modules/moment/min/moment-with-locales.js",
                  "node_modules/moment-timezone/builds/moment-timezone-with-data.js",
                  "node_modules/push.js/bin/push.js",
                  "node_modules/quill/dist/quill.js",
                  "node_modules/sweetalert2/dist/sweetalert2.js",
                  "node_modules/cookieconsent/build/cookieconsent.min.js",
    
                  "src/assets/abp-web-resources/abp.js",
                  "src/assets/abp-web-resources/abp.sweet-alert.js",
                  "src/assets/abp-web-resources/abp.notify.js",
                  "src/assets/canvas-toBlob/canvas-toBlob.js",
                  "node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.moment.js",
    
                  "src/assets/metronic/vendors/global/vendors.bundle.js",
                  "src/assets/metronic/common/js/scripts.bundle.js"
                ],
                "assets": [
                  "src/assets",
                  "src/favicon.ico",
                  {
                    "glob": "abp.signalr-client.js",
                    "input": "node_modules/abp-web-resources/Abp/Framework/scripts/libs",
                    "output": "/assets/abp"
                  }
                ]
              }
            },
            "lint": {
              "builder": "@angular-devkit/build-angular:tslint",
              "options": {
                "tsConfig": [
                  "src/tsconfig.json"
                ],
                "exclude": []
              }
            }
          }
        },
        "abp-zero-template-e2e": {
          "root": "",
          "sourceRoot": "",
          "projectType": "application",
          "architect": {
            "e2e": {
              "builder": "@angular-devkit/build-angular:protractor",
              "options": {
                "protractorConfig": "./protractor.conf.js",
                "devServerTarget": "abp-zero-template:serve",
                "port": 4200
              }
            },
            "lint": {
              "builder": "@angular-devkit/build-angular:tslint",
              "options": {
                "tsConfig": [
                  "e2e/tsconfig.json"
                ],
                "exclude": []
              }
            }
          }
        }
      },
      "defaultProject": "abp-zero-template",
      "schematics": {
        "@schematics/angular:component": {
          "prefix": "app",
          "styleext": "css"
        },
        "@schematics/angular:directive": {
          "prefix": "app"
        }
      }
    }
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @timmackey

    Can we reproduce this with the project you have shared with us recently ? If not, can you share your angular project via email ?

    Thanks,

  • User Avatar
    0
    timmackey created

    please check email for angular project files

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi Tim,

    Thank you for sharing the project. It seems like the problem is caused by https://github.com/DefinitelyTyped/DefinitelyTyped/issues/55430. So, changing the @types/node dependency as shown below fixes this problem;

    "@types/node": "12.20.20",

    But, it introduces other problems. The first one I faced is, below statement becomes invalid;

    import { ModalDirective } from 'ngx-bootstrap';

    You need to change it to;

    import { ModalDirective } from 'ngx-bootstrap/modal';

    Let me know if you see any other problems after fixing those problems.

  • User Avatar
    0
    timmackey created

    The proposed solution requires changing the input on 52 ANZ-authored files, Build then reports 50 new errors.

    This can't be the solution, since vanilla ver 8.4.0 builds and runs without error. Only when I add my app-specific modules does the error appear. I'm not able to determine which modules(s) cause the error.

    My app builds and runs without error for ver 8.3.1

  • User Avatar
    0
    timmackey created

    I'm abandoning this approach temporarily. Going directly to 11.0.1.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @timmackey

    Thanks for the update. If you want to upgrade to v11.0.1, that's totally fine but it might take longer time than fixing problems you are facing with 8.4.0.

  • User Avatar
    0
    timmackey created

    I've abandoned attempting to upgrade to 8.4.0, and am going directly to 10.0.0,