简体   繁体   English

“ ng new my-app”错误

[英]'ng new my-app' error

I am trying to generate a new project and skeleton application using the latest version of Angular. 我正在尝试使用最新版本的Angular生成一个新项目和框架应用程序。 I have tried uninstalling and reinstalling Angular CLI using: 我尝试使用以下方法卸载和重新安装Angular CLI:

C:\>npm install -g @angular/cli@latest
C:\>ng --version

@angular/cli: 1.4.5
node: 8.8.1
os: win32 x64

This error occurs when trying to run 'ng new my-app' in command prompt: 尝试在命令提示符下运行“ ng new my-app”时发生此错误:

'Error: The command "new" has an option without the required type and name field'

Any help to resolve this issue is appreciated. 感谢您为解决此问题提供的任何帮助。

This is a known issue and there is an issue raised in github for this. 这是一个已知问题,因此在github中提出了一个问题。

https://github.com/angular/angular-cli/issues/7984 https://github.com/angular/angular-cli/issues/7984

Try below commands: 请尝试以下命令:

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest

After these steps: 这些步骤之后:

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest

Do: 做:

npm install @schematics/angular

And then: 接着:

ng new appname

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用更新的@angular/cli 命令“ng new my-app”时出现问题 - Problem using command “ng new my-app” with updated @angular/cli npx create-react-app my-app 在安装新版本的 NodeJS 后给我以下错误? - npx create-react-app my-app giving me the following error after installing new version of NodeJS? 如何在 angular 中上传 csv 文件 13 错误:“my-app” - How to upload csv file in angular 13 Error:"my-app" 使用“dotnet new react -o my-app”中的默认代码时,为什么会出现 JSON.parse 错误? - Why do I get JSON.parse error when using default code from “dotnet new react -o my-app”? Vs 代码中的 npx-create-react-app my-app 命令错误 - npx-create-react-app my-app command ERROR in Vs Code 遵循my-app教程中的说明时,React JS引发错误 - React JS is throwing an error while following the instructions from my-app tutorial 下载 Svelte 错误:可以继续吗? (y) cd my-app svelte - Download Svelte error: Ok to proceed? (y) cd my-app svelte Reactjs create-react-app my-app 后端集成 - Reactjs create-react-app my-app backend integration npx create-react-app my-app 错误:rollbackFailedOptional - npx create-react-app my-app ERORR: rollbackFailedOptional ModuleNotFoundError:找不到模块:错误:无法解析“/vercel/workpath0/my-app/pages”中的“../components/charts/be.js” - ModuleNotFoundError: Module not found: Error: Can't resolve '../components/charts/be.js' in '/vercel/workpath0/my-app/pages'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM