【发布时间】:2018-03-31 23:39:30
【问题描述】:
到目前为止,我设法运行 ng serve,但由于 4 或 5 天我无法解决问题,我尝试了网络上提出的所有解决方案,但没有任何效果......
这就是为什么我真诚地需要你的帮助! 我怎样才能翻新所有东西以确保它能够正常工作?
package.json:
{
"name": "cli-src",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}
有关信息,我在 WINDOWS 上。
非常感谢愿意帮助我的人!
【问题讨论】:
-
您需要提供您的错误信息的具体代码和详细信息。
-
你试过了吗:
npm uninstall @angular/cli -g和npm cache clean和npm install @angular/cli -g -
当我这样做时:
npm cache clean我有:npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. npm ERR! npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force. npm ERR! A complete log of this run can be found in:npm ERR! C:\Users\bmmi\AppData\Roaming\npm-cache\_logs\2017-10-19T20_37_50_555Z-debug.log -
使用
--force开关 -
检查
ng是否在node_modules\.bin中。如果它在那里并且您仍然收到此错误。使用npm install -g <package-name>全局安装它
标签: node.js angular angular-cli