Set default host and port for ng serve in config file
I want to know if i can set a host and a port in a config file so I don’t have to type ng serve –host foo.bar –port 80 instead of just ng serve 13 Answers 13
I want to know if i can set a host and a port in a config file so I don’t have to type ng serve –host foo.bar –port 80 instead of just ng serve 13 Answers 13
I periodically run into the problem, having to spin up old Angular projects with deprecated dependencies of Angular. Because I unsually run the latest Node.js version (at least lates LTS version) I often had the problem, that I wasn’t able to get the old projects running. I solved this by using a node version manager, … Read more
I have travis-ci integrated with my GitHub account (https://github.com/pradeep0601/Angular5-Router-App). When I updated @angular/cli version from 1.7.4 to 6.0.0-rc.3, the build started failing with an error: Local workspace file (‘angular.json’) could not be found. Error: Local workspace file (‘angular.json’) could not be found. at WorkspaceLoader._getProjectWorkspaceFilePath (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/workspace-loader.js:37:19) at WorkspaceLoader.loadWorkspace (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/workspace-loader.js:24:21) at TestCommand._loadWorkspaceAndArchitect (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/architect-command.js:177:32) at TestCommand.<anonymous> (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/architect-command.js:45:25) at … Read more
ng serve serves an Angular project via a development server npm start runs an arbitrary command specified in the package’s “start” property of its “scripts” object. If no “start” property is specified on the “scripts” object, it will run node server.js. It seems like ng serve starts the embedded server whereas npm start starts … Read more
When running the terminal commands ng server or ng serve –live-reload=true, I’m getting this issue: The serve command requires to be run in an Angular project, but a project definition could not be found. 43 Answers 43 I was also getting this issue and solved by running below command. ng update @angular/cli –migrate-only –from=<WhateverVersionYouAreCurrentlyOn> e.g. … Read more
Is there a way to run ng test for a single file instead of for the entire test suite? Ideally, I’d like to get the quickest possible feedback loop when I’m editing a file, but karma executes the whole suite on each save, which is a bit slow when you build up a big enough … Read more
Is there a way to check the specific version of angular-cli that’s installed globally on my machine? I’m in a Windows environment. *npm -v* and *node -v* only gives me the version of npm and node respectively, and I can’t seem to find any commands with ng. I’m trying to run a project that I’m … Read more
I have Angular2 project build with Angular-CLI (beta 20). Is there a way to run tests against only one selected spec file? I used to have a project based on Angular2 quick start, and I could manually add specs to jasmine file. But I don’t know how to set this up outside of karma testing … Read more
I’m starting to use angular-cli and I’ve already read a lot to find an answer about what I want to do…no success, so I came here. Is there a way to create a component to a new module? e.g.: ng g module newModule ng g component newComponent (how to add this component to newModule??) because … Read more
I am trying to update my Angular 5.2 app to Angular 6. I successfully followed instructions in the Angular update guide (including the update of angular-cli to v6), and now I am trying to serve the app via ng serve –env=local But this gives me error: Unknown option: ‘–env’ I use multiple environments (dev/local/prod), and … Read more