gpt4 book ai didi

Angular 迁移(从 4 到 6)警告 - 无法解析流

转载 作者:行者123 更新时间:2023-12-02 16:30:29 25 4
gpt4 key购买 nike

我将 Angular 应用程序从 4 升级到 6 时几乎没有遇到任何问题。只有这个令人恼火的警告出现在我的控制台中:

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

我已经尝试删除 node_modules 指令并执行 npm install 但错误仍然出现。我也尝试添加

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

进入我的tsconfig.json文件。没有任何帮助。另外通过谷歌搜索我还没有找到有用的解决方案。有人可能更了解吗?

编辑

应该提到的是我正在使用的依赖项:

"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"
}

最佳答案

参见this ...

有一些评论说安装流包可以解决问题:

npm install stream --save

其他sources ,建议将 stream 包替换为 readable-stream,但我知道这不适合您。

关于 Angular 迁移(从 4 到 6)警告 - 无法解析流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51925653/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com