I have created a new angular project with the ng new command.
Angular CLI: 14.2.0
Node: 16.14.0
Package Manager: npm 8.3.1
OS: darwin arm64
Angular: 14.1.3
It has created a project which includes angular.json and the commands ng serve, and ng build were working. I just learned that angular.json is no longer used it was managed by angular CLI in the latest angular 14 versions. So, I tried to delete angular.json from my root project. But now the ng commands were not working.
The ng serve command gives the error: This command is unavailable when running the Angular CLI outside a workspace.
What does it mean? How can I fix this issue? Is it necessary to keep angular.json for workspace configuration? How can I serve my project without angular.json?
Related
I'm trying to create a frontend project in Vite, using the yarn create vite command, but I'm getting the following error:
If I create the project with npm (npm create vite#latest), nothing wrong happens and the project is created successfully, my problem is only when using yarn.
My installed Node version is latest 18.12.1 LTS
I wasn't having this problem, what should I do?
I have successfully created a Nuxt.js project with this configuration using the CLI:
Project name: test
Programming language: JavaScript
Package manager: Npm
UI framework: None
Nuxt.js modules: None
Linting tools: None
Testing framework: None
Rendering mode: Single Page App
Deployment target: Static (Static/JAMStack hosting)
Development tools: jsconfig.json
Version control system: Git
The developement server runs properly with npm run dev.
npm run build also runs without errors and tells me that:
Ready to run nuxt generate
But the execution of nuxt generate leads to the error Command 'nuxt' not found. This is strange because nuxt seems to be installed when I execute npm nuxt list.
I first reinstalled just nuxt and then all dependencies after deleting the node_modules/ folder, but the error remains the same. If I just run npm run start it tells me
Nuxt Fatal Error
Error: Output directory `dist/` does not exists, please use
`nuxt generate` before `nuxt start` for static target.
This is strange again because the .nuxt/dist/ folder exists.
Does anyone have an idea what is going wrong?
I have solved the problem. For me it works if I run npm run generate instead of nuxt generate.
I am trying to run Gulp 3.9.0 in my project folder and have downgraded my Gulp via npm install gulp#3.9.0. However, it seem like only my local version of gulp is 3.9.0. How do I get my CLI to the same version?
I am having trouble with this error, my project need run angular/cli version 1.7.4 and Nodejs 6.10.3 .But the past I used angular cli version 6 and now I want to downgrade to angular cli 1.7.4 but I don't know how to downgrade angular cli version 6 at my global. I try to use npm uninstall -g #angular/cli and then I install the version I want by command npm install -g #angular/cli#1.7.4 but when I check ng -v it's still have a error in picture
P/S: I were updated my npm to latest version to make sure can remove angular cli version but still don't work
Keep your global package running at the highest version. If a project needs CLI 1.x, use the npm run commands instead.
Any npm commands run use the project's CLI, not your global version.
We want to use Angular CLI for our projects within ASP.NET core. As output we choose wwwroot instead of dist. The default ng serve enables hot module replacement automatically. But now we need to have hot module replacement with kestrel and iis integration. We decided not to use the AspNet core Javascriptservices because we want to use Angular CLI as the default.
Does anyone know how to do enable hot module replacement with Angular CLI and the ASP.NET core standard hostring with staticfiles within the wwwroot?
I am able to run angular cli with these steps.
Make sure you have latest typescript install on your system.
Create asp.net core angular template project in Visual Studio 2017.
Now update all the npm packages with npm-check-updates
Install npm packages with
npm install
Install angular/cli globally
npm install #angular/cli#latest -g
Install angular/cli locally
npm install #angular/cli#latest --save-dev
Create an angular project outside your main project on any temp location with this command:
ng new hello-world
Now, go to project directory and copy .angular-cli.json file into the root of your main dot net core project.
Then you have to edit this part of the file:
"root" : "src" change to "root" : "ClientApp"
Everythings was done!
Now, go to your component directory of your project:
cd ClientApp/app/components
and make your component in component directory in terminal:
ng g c MyComponent --module='app.module.browser.ts'
The answer is that we have to accept on the local host environment to have 2 local host servers running together when developing. Ng serve with webpack dev server for the client code (angular app) and iis express with kestrel for web api or MVC... This way you can use hot module replacement with ng serve.