Update(EDIT):
我做到了
npm i -g npm-check-updates
npm-check-updates -u
npm install
现在它显示了这些错误
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN @angular/animations@5.1.2 requires a peer of @angular/core@5.1.2 but none was installed.
npm WARN @angular/compiler-cli@5.1.1 requires a peer of typescript@>=2.4.2 <2.6 but none was installed.
npm WARN tsickle@0.25.5 requires a peer of typescript@>=2.4.2 <2.6 but none was installed.
并且浏览器显示:
ENOENT:没有这样的文件或目录,scandir'E:\ xuf \ Angular \ Practice \ todo \ node_modules \ webpack \ hot'@(webpack)-dev-server / client?http://0.0.0.0:0 @ multi webpack-dev-server / client?http://0.0.0.0:0 ./src/main.ts
我用这个命令安装了角度动画
npm install @ angular / animations --save
出现此错误,动画也不起作用 . 什么地方出了错?
@ angular / animations @ 5.1.2需要@ angular / core @ 5.1.2的对等,但没有安装
ng -v的结果
Angular CLI: 1.5.5
Node: 6.11.4
OS: win32 x64
Angular: 5.1.1
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router
@angular/animations: 5.1.2
@angular/cli: 1.5.5
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.5
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.8.1
package.json:
{
"name": "todo",
"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/animations": "^5.1.2",
"@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",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"ng-pick-datetime": "^5.0.0-beta.15",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.6.2",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
"@types/jasmine": "~2.8.2",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~8.5.2",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.2.2",
"ts-node": "~4.0.2",
"tslint": "~5.8.0",
"typescript": "~2.6.2"
}
}