作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
重新启动计算机后,我的项目突然在运行 npm run start 时出现此错误。我卸载/重新安装了节点,删除了节点模块,重新安装了 angular-cli,多次运行 npm install,但仍然出现相同的错误。我可以看到 @angular 文件夹在那里,里面有核心文件夹。
我检查了人们遇到类似问题的线程,但没有任何帮助。关于此错误的信息似乎很少,只有一两个异常(exception)。
有没有人遇到过这个问题?
packages.json
{
"name": "ag-grid-demo",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-devkit/core": "^7.2.0",
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"@ng-bootstrap/ng-bootstrap": "^4.0.1",
"ag-grid-angular": "^20.0.0",
"ag-grid-community": "^20.0.0",
"ag-grid-enterprise": "^20.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.6.1",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"lodash": "^4.17.11",
"protractor": "^5.4.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
}
}
最佳答案
我解决了这个问题。我根本不需要碰我的包裹。由于某些奇怪的原因,我的 tsconfig.json 已损坏。我恢复了它,删除了 node_modules,删除了 package-lock.json 并运行
npm 安装
关于angular - npm/Angular 问题 : Could not resolve module @angular/core,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54595534/
我是一名优秀的程序员,十分优秀!