Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular migration (from 4 to 6) warning - Cant resolve stream

I had almost no problems upgrading my Angular app from 4 to 6. Only this irritating warning appears into my Console:

WARNING in ./node_modules/sax/lib/sax.js
Module not found: Error: Can't resolve 'stream' in 'D:\user\app\node_modules\sax\lib'

I already tried to delete the node_modules directive and executed npm install but the error still appears. Ive also tried to add

"paths": {
        "sax": [
            "../node_modules/sax/lib/sax.js"
        ]
    }

into my tsconfig.json file. Nothing helped. Also by googling I have not found a helpful solution. Does anyone maybe know better?

Edit

What should be mentioned is the dependencies that Im exactly using:

"dependencies": {
    "@angular/common": "6.1.3",
    "@angular/compiler": "6.1.3",
    "@angular/core": "6.1.3",
    "@angular/forms": "6.1.3",
    "@angular/http": "6.1.3",
    "@angular/platform-browser": "6.1.3",
    "@angular/platform-browser-dynamic": "6.1.3",
    "@angular/router": "6.1.3",
    "ag-grid": "^15.0.0",
    "ag-grid-angular": "^15.0.0",
    "angular2-multiselect-dropdown": "^2.5.0",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "enhanced-resolve": "^3.3.0",
    "ngx-bootstrap": "^2.0.1",
    "ngx-cookie-service": "^1.0.10",
    "rxjs": "6.2.2",
    "tinymce": "^4.6.3",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@PB/tslint-rules": "^0.7.0",
    "@angular-devkit/build-angular": "~0.7.0",
    "@angular/cli": "^6.1.3",
    "@angular/compiler-cli": "6.1.3",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.2",
    "cxml": "^0.1.1",
    "jasmine-core": "^2.9.0",
    "jasmine-reporters": "^2.2.1",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "^3.0.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-junit-reporter": "^1.2.0",
    "karma-phantomjs-launcher": "^1.0.4",
    "protractor": "~5.1.0",
    "protractor-jasmine2-html-reporter": "0.0.7",
    "rxjs-compat": "^6.2.2",
    "ts-node": "^3.2.0",
    "tslint": "^5.10.0",
    "tslint-sonarts": "^1.4.0",
    "typescript": "^2.9.2"
  }
like image 692
MarcoLe Avatar asked Mar 05 '23 14:03

MarcoLe


1 Answers

See this...

There are several comments as installing the stream package solves the problem:

npm install stream --save

In other sources, it's recommended to replace the stream package by readable-stream, but I understand is not an option for you.

like image 101
agascon Avatar answered Mar 18 '23 10:03

agascon