我遇到了这个问题,到目前为止似乎没有任何答案.虽然我在node_modules文件夹中看到了tslib.感谢是否有人可以帮助确定我的代码有什么问题.我已经看到了对类似问题的其他回复,我尝试删除node_modules并重建整个项目.但我仍然遇到同样的问题
Uncaught Error: Cannot find module "tslib".
at webpackEmptyContext (VM2488 main.js:11)
at VM2487 vendor.js:30768
at push../node_modules/@angular/compiler/src/core.js (VM2487 vendor.js:30756)
at Object../node_modules/@angular/compiler/src/core.js (VM2487 vendor.js:30765)
at __webpack_require__ (VM2484 runtime.js:77)
at Object../src/app/data.service.ts (VM2488 main.js:2712)
at __webpack_require__ (VM2484 runtime.js:77)
at Object../src/app/Security/Security.service.ts (VM2488 main.js:1923)
at __webpack_require__ (VM2484 runtime.js:77)
at Object../src/app/Security/Security.component.ts (VM2488 main.js:1556)
Run Code Online (Sandbox Code Playgroud)
的package.json
{
"name": "ranetworkfe",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.0.3",
"@angular/cli": "^6.1.2", …Run Code Online (Sandbox Code Playgroud)