-
Notifications
You must be signed in to change notification settings - Fork 12k
"Workspace needs to be loaded before it is used." when trying to generate a new Service. #10757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same here using |
Do you have angular.json on project root. |
@BlueSolution I do. |
actually i have the same problem, i found out that when updating angular it deletes angular-cli.json and adds an empty angular.json file. in the created file nothing related to project. am trying to add options to the new file but not sure that it will work because am receiving the same error .
|
I had the same experiance. i tried to create new angular.json file but still no lucks :( |
EUREKA............. dotnet new angular comman does not create an angular.json file on the root of the application. in some sites they say that after using
I solved the problem by creating my own angular.json file as bellow (you may change vega with your project name) after that i was able to use angular cli command and create components and services.
|
This bug might be due to syntax error. If you miss simple comma while referencing the css in styles array, you can get this error. This is how I fixed it for me. Error : Missed comma after adding bootstrap css in styles array. After which you can see this bug.
Solution : Adding comma after "../node_modules/bootstrap/dist/bootstrap.min.css", fixes the problem for me.
|
This link helps: Angular Update Guide | 5.2 -> 6.0 for Basic Apps Replace downgradeComponent, downgradeInjectable, UpgradeComponent, and UpgradeModule imported from @angular/upgrade. Instead use the new versions in @angular/upgrade/static Switch from HttpModule and the Http service to HttpClientModule and the HttpClient service. HttpClient simplifies the default ergonomics (You don't need to map to json anymore) and now supports typed return values and interceptors. Read more on angular.io During the Update Make sure you are using Node 8 or later Update your Angular CLI globally and locally, and migrate the configuration to the new angular.json format by running the following: npm install -g @angular/cli Update all of your Angular framework packages to v6, and the correct version of RxJS and TypeScript. ng update @angular/core After the update, TypeScript and RxJS will more accurately flow types across your application, which may expose existing errors in your application's typings Update Angular Material to the latest version. ng update @angular/material This will also automatically migrate deprecated APIs. Use ng update or your normal package manager tools to identify and update other dependencies. After the Update Remove deprecated RxJS 6 features using rxjs-tslint auto update rules. For most applications this will mean running the following two commands: npm install -g rxjs-tslint Once you and all of your dependencies have updated to RxJS 6, remove rxjs-compat. |
I have confirmed that if you have a syntax problem in your angular.json file there this error happens. I would say this is unexpected behavior and should be changed to say there is a syntax problem in the file instead. |
check your angular-cli.json is only or not , remove read only will be fine. |
Check your misspelling on angular.json |
Works for me. Or you can just remove the file. |
A blank (e.g. created by command: touch) angular-config.json in home directory can also cause this problem. |
Well, looks like any errors on In my case, |
Using Angular 8 and this is still occurring for me on OS X when using ng new. |
Team Please help me to get rid of this. Os version: win 10 64 bit I reinstalled node several times and uninstalled angular and npm as well for several times and cleared cache also. At the time of Installing angular It looks like below Image: |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
Observed behavior
Desired behavior
Should create a new component.
Created the project using Angular CLI. Tried other projects and getting the same result.
The text was updated successfully, but these errors were encountered: