gpt4 book ai didi

angular - Uncaught Error : Cannot find module "tslib"

转载 作者:太空狗 更新时间:2023-10-29 19:36:35 30 4
gpt4 key购买 nike

我正在测试我的 Angular 应用程序,在没有更改任何内容的情况下进行了一些成功测试后,我收到以下错误:

HeadlessChrome 68.0.3440 (Mac OS X 10.12.6) ERROR Uncaught Error: Cannot find module "tslib". at http://localhost:9877/_karma_webpack_/main.js:150

有人遇到同样的问题吗?

package.json
{
"name": "test",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "cross-env ng serve",
"start:proxy": "cross-env ng serve --proxy-config proxy.conf.json",
"mock:server": "json-server --watch data.json",
"start:ps": "cross-env concurrently --kill-others \"npm run mock:server\" \"npm run start:proxy\"",
"build": "ng build",
"test": "ng test --watch=false",
"test:local:coverage": "ng test --watch=false --codeCoverage",
"test:local:watch": "ng test --watch=true",
"lint": "ng lint",
"e2e": "ng e2e",
"show:coverage": "http-server -c-1 -o -p 9875 ./coverage",
"pre-push": "npm run lint && npm run build && npm run test"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.4",
"@angular/cdk": "^6.4.6",
"@angular/common": "^6.0.3",
"@angular/compiler": "^6.0.3",
"@angular/core": "^6.0.3",
"@angular/forms": "^6.0.3",
"@angular/http": "^6.0.3",
"@angular/material": "^6.4.6",
"@angular/platform-browser": "^6.0.3",
"@angular/platform-browser-dynamic": "^6.0.3",
"@angular/router": "^6.0.3",
"bootstrap": "^4.1.3",
"core-js": "^2.5.4",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"http-server": "^0.11.1",
"intl": "^1.2.5",
"normalize.css": "^8.0.0",
"rxjs": "^6.2.2",
"rxjs-compat": "^6.2.2",
"tslib": "^1.9.3",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/compiler-cli": "^6.0.3",
"@angular-devkit/build-angular": "~0.6.8",
"typescript": "~2.7.2",
"@angular/cli": "~6.0.8",
"@angular/language-service": "^6.0.3",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"concurrently": "^4.0.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1"
}
}

最佳答案

在你的资源中的某处你有:

import { ... } @angular/compiler/src/core

你应该在哪里:

import { ... } @angular/core

关于angular - Uncaught Error : Cannot find module "tslib",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52064679/

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