The ng new command creates an Angular workspace folder and generates a new application skeleton. A workspace can contain multiple applications and libraries. The initial application created by the ng new command is at the top level of the workspace.
This error often occurs when a project you are running is not an Angular project. It may also be the case when you download an Angular project but do not have latest dependencies installed on your machine. Installing latest dependencies should fix the problem.
ng buildlink. Compiles an Angular application or library into an output directory named dist/ at the given output path.
Same as John Pankowicz answer, but in my case I had to run
npm install -g @angular/cli@latest
for the versions to match.
npm uninstall -g angular-cli @angular/cli
npm cache clean
npm install -g @angular/cli
use sudo on Mac/Linux.
Ok, found it.
package.json must contain a dependency to angular-cli.
When I uninstalled my local angular-cli, npm also removed the dependency entry.
It worked in my case
sudo npm uninstall -g angular-cli @angular/cli
sudo npm cache clean --force
npm install npm@latest -g
sudo npm install -g @angular/cli
I had the same error message. But the cause and solution are slightly different. When I ran "ng -v" it showed different versions for angular-cli (1.0.0-beta.28.3) and @angular/cli (1.0.0-beta.31). I re-ran:
npm install -g @angular/cli
Now both show a version of 1.0.0-beta.31. The error message is gone and "ng serve" now works. (Yes - it was @angular/cli that I re-installed and the angular-cli version was updated.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With