我有Windows 10,节点v11.0.0和Angular CLI:7.1.4,并在创建新的angular应用程序时遇到此错误。 npm ERR!代码E404 npm ERR!找不到404:@ angular / animations @〜7.1.0。
错误堆栈:
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Software\\node-v11.0.0-win-x64\\node.exe',
1 verbose cli 'D:\\Software\\node-v11.0.0-win-x64\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--quiet' ]
2 info using npm@6.4.1
3 info using node@v11.0.0
4 verbose npm-session 56bc1a48a2be70ea
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall myapp@0.0.0
7 info lifecycle myapp@0.0.0~preinstall: myapp@0.0.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 12ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 3ms
16 silly install loadAllDepsIntoIdealTree
**Packaage.json :**
{
"name": "myapp",
"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": "~7.1.0",
"@angular/common": "~7.1.0",
"@angular/compiler": "~7.1.0",
"@angular/core": "~7.1.0",
"@angular/forms": "~7.1.0",
"@angular/platform-browser": "~7.1.0",
"@angular/platform-browser-dynamic": "~7.1.0",
"@angular/router": "~7.1.0",
"core-js": "^2.5.4",
"rxjs": "~6.3.3",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.11.0",
"@angular/cli": "~7.1.4",
"@angular/compiler-cli": "~7.1.0",
"@angular/language-service": "~7.1.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.6"
}
}
答案 0 :(得分:0)
这可能是因为未在@angular/animations
中定义
您的package.json。
请确保将其添加到您的package.json
依赖项中
安装npm依赖项。
package-lock.json
并
重新安装npm
依赖项(npm install
)。AppModule
或使用的任何地方(任何
子模块)。