创建新的Angular项目时遇到麻烦 [英] Having trouble in creating a new Angular project
问题描述
我尝试创建一个新的角度项目,但出现此错误只是知道我拥有最新版本的angular,并且对于节点JS我正在使用12.16.2.
- ng新项目
输出:
/正在安装软件包... npm WARN不推荐使用tslint@6.1.1:为了支持ESLint,不推荐使用TSLint.请参阅
分辨率屏幕简短:
i tried to create a new angular project but i am having this error just to know i have the latest version of angular and for node JS i am using the 12.16.2.
- ng new project
the output :
/ Installing packages...npm WARN deprecated tslint@6.1.1: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm WARN deprecated fsevents@1.2.12: fsevents 1 will break on node v14+. Upgrade to fsevents 2 with massive improvements. npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm ERR! Unexpected end of JSON input while parsing near '...er","version":"2.4.9"'
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\dell\AppData\Roaming\npm-cache_logs\2020-04-21T17_57_57_578Z-debug.log × Package install failed, see above. The Schematic workflow failed. See above.
It looks like it is a cache error. Reinstalling Angular CLI after clearing the npm cache. The below solution work for me, run below 3 commands one by one
- npm install chokidar
- npm cache clean --force
- npm install -g @angular/cli@latest
Issue
Resolution screen short:
这篇关于创建新的Angular项目时遇到麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!