我有一个项目,正在尝试安装npm,但出现以下错误:
npm ERR! code EINVALIDPACKAGENAME npm ERR! Invalid package name "@
angular / platform-browser / animations": name can only contain
URL-friendly character`
我正在使用Angular 8
我的package.json
:
{
"name": "cingo-render",<br>
"version": "1.0.0",<br>
"description": "Cingo-Render",<br>
"author": "",<br>
"license": "MIT",<br>
"dependencies": {<br>
"@angular/common": "~5.2.2",<br>
"@angular/compiler": "~5.2.2",<br>
"@angular/core": "~5.2.2",<br>
"@angular/forms": "~5.2.2",<br>
"@angular/http": "~5.2.2",<br>
"@angular/platform-browser": "~5.2.2",<br>
"@angular/platform-browser-dynamic": "~5.2.2",<br>
"@angular/router": "~5.2.2",<br>
"@angular/animations": "~5.2.2",<br>
"@angular/platform-browser/animations": "~5.2.2",<br>
"@angular/animations/browser": "~5.2.2",<br>
"@types/node": "^7.0.11",<br>
"@types/core-js": "^0.9.39",<br>
"systemjs": "0.19.40",<br>
"core-js": "^2.4.1",<br>
"reflect-metadata": "^0.1.10",<br>
"rxjs": "5.5.6",<br>
"zone.js": "^0.8.4",<br>
"typescript": "2.7.1",<br>
"@swimlane/ngx-datatable": "11.3.0",<br>
"ngx-mask": "2.4.4",<br>
"ngx-mydatepicker": "2.4.5",<br>
"@ng-select/ng-select": "1.6.1",<br>
"web-animations-js": "2.3.1",<br>
"ngx-device-detector": "1.3.3"<br>
}
}
答案 0 :(得分:0)
您在“ @ angular /平台浏览器/动画”中有空格
它不应该有空格和其他东西 我认为你需要这个包裹 https://www.npmjs.com/package/@angular/platform-browser
答案 1 :(得分:0)
尝试更新您的节点版本,我在使用 10.**.??
时遇到了类似的问题,我升级到了 15.11.0
。
然后 npm i
工作正常