gpt4 book ai didi

angular - 我有时会在 Azure DevOps "Error: Cannot find module ' symbol-observable 中收到这样的错误'"

转载 作者:行者123 更新时间:2023-12-03 06:58:13 25 4
gpt4 key购买 nike

有时我在 Azure Devops Angular 项目中收到以下错误。错误:找不到模块“symbol-observable”虽然系统中安装了该模块,但仍然报错。我手动触发的时候没有出现这个错误,有时会成功3次。有时它会自动尝试成功。我并不总是服用,但如果服用一次,我就会反复服用。您能提出解决方案吗?

full error detail

- C:\agent\_work\7\s\node_modules\@angular\cli\lib\init.js
- C:\agent\_work\7\s\node_modules\@angular\cli\bin\ng
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (C:\agent\_work\7\s\node_modules\@angular\cli\lib\init.js:10:1)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\agent\\_work\\7\\s\\node_modules\\@angular\\cli\\lib\\init.js',
'C:\\agent\\_work\\7\\s\\node_modules\\@angular\\cli\\bin\\ng'
]
}
##[error]Cmd.exe exited with code '1'.
Finishing: ng build

ng build setting is as below

node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --configuration production

enter image description here

The installed package list is as follows. package.json info

{
"dependencies": {
"@angular-devkit/architect": "^0.1400.1",
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.3",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/http": "^7.2.16",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/platform-server": "^8.2.14",
"@angular/router": "^8.2.14",
"@fortawesome/fontawesome-free": "^5.12.0",
"@ng-bootstrap/ng-bootstrap": "^5.1.5",
"@ngrx/effects": "^8.6.0",
"@ngrx/entity": "^8.6.0",
"@ngrx/router-store": "^8.6.0",
"@ngrx/store": "^8.6.0",
"@ngrx/store-devtools": "^8.6.0",
"@ngx-loading-bar/core": "^4.2.0",
"@ngx-translate/core": "^11.0.1",
"@types/jquery": "^3.5.14",
"@types/lodash": "^4.14.149",
"angular-in-memory-web-api": "^0.8.0",
"bootstrap": "^4.4.1",
"chart.js": "^2.9.3",
"chartist": "^0.11.4",
"classlist.js": "^1.1.20150312",
"clean-webpack-plugin": "^4.0.0",
"core-js": "^3.6.2",
"cross-env": "^7.0.3",
"del-cli": "^4.0.1",
"devextreme": "^17.2.3",
"devextreme-angular": "^17.2.3",
"devextreme-intl": "^17.2.4",
"globalize-webpack-plugin": "^3.0.0",
"hammerjs": "^2.0.8",
"highlight.js": "^9.17.1",
"highlightjs-line-numbers.js": "^2.8.0",
"install": "^0.13.0",
"jquery": "3.1.1",
"lodash": "^4.17.11",
"material-design-icons": "^3.0.1",
"material-design-icons-iconfont": "^6.7.0",
"metronic-angular": "file:",
"moment": "^2.18.1",
"ng-inline-svg": "^9.2.2",
"ngrx-store-freeze": "^0.2.4",
"ngx-clipboard": "^12.3.0",
"ngx-highlightjs": "^3.0.3",
"ngx-perfect-scrollbar": "^8.0.0",
"ngx-permissions": "^7.0.3",
"ngx-toastr": "^11.3.3",
"object-path": "^0.11.4",
"perfect-scrollbar": "^1.4.0",
"popper.js": "^1.16.0",
"rxjs": "^6.5.4",
"sass-loader": "^7.3.1",
"socicon": "^3.0.5",
"style-loader": "^2.0.0",
"tooltip.js": "^1.3.3",
"tslib": "^1.10.0",
"web-animations-js": "^2.3.2",
"webpack": "^4.46.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.803.29",
"@angular/cli": "^8.3.22",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@angular/material": "^8.2.3",
"@angular/material-moment-adapter": "^8.2.3",
"@ngrx/schematics": "^8.6.0",
"@types/chartist": "^0.9.46",
"@types/highlight.js": "^9.12.3",
"@types/jasmine": "^3.5.0",
"@types/jasminewd2": "^2.0.8",
"@types/node": "^12.12.24",
"@types/object-path": "^0.11.0",
"codelyzer": "^5.2.1",
"css-loader": "^5.2.7",
"devextreme-cldr-data": "^1.0.3",
"html-webpack-plugin": "^5.5.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^2.1.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.5.1",
"link": "^1.4.1",
"mini-css-extract-plugin": "^2.6.0",
"npm": "^8.9.0",
"protractor": "~5.4.2",
"sass": "^1.51.0",
"ts-node": "~8.2.0",
"tslint": "~5.17.0",
"typescript": "~3.4.5",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^3.3.12",
"webpack-dev-middleware": "^5.3.1",
"webpack-dev-server": "^4.9.0",
"webpack-messages": "^2.0.4",
"webpack-rtl-plugin": "^2.0.0"
}
}

最佳答案

enter image description here

根据我的研究,模块“symbol-observable”基于此 devDependencies:

“@angular/cli”

我认为问题来自“npm install”步骤。当它尝试安装模块“symbol-observable”时,失败了。

因此,请检查 Angular 应用程序的“node_modules”文件夹中是否存在“symbol-observable”。

您可以转到 package.json 所在的 Angular 应用程序的文件夹,然后直接在应用程序中运行命令“npm install”以确保模块已安装。

并且,如果您的管道基于 Microsoft Host Agent,由于它每次都会分配不同的机器,您可以尝试在可以在本地成功构建的机器上使用 self Host Agent。

https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser#install

关于angular - 我有时会在 Azure DevOps "Error: Cannot find module ' symbol-observable 中收到这样的错误'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72712269/

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