ashish@ashish-Inspiron-3521:~/Angular$ ng new FireStore
create FireStore/README.md (1025 bytes)
create FireStore/.angular-cli.json (1245 bytes)
create FireStore/.editorconfig (245 bytes)
create FireStore/.gitignore (544 bytes)
create FireStore/src/assets/.gitkeep (0 bytes)
create FireStore/src/environments/environment.prod.ts (51 bytes)
create FireStore/src/environments/environment.ts (387 bytes)
create FireStore/src/favicon.ico (5430 bytes)
create FireStore/src/index.html (296 bytes)
create FireStore/src/main.ts (370 bytes)
create FireStore/src/polyfills.ts (3114 bytes)
create FireStore/src/styles.css (80 bytes)
ashish@ashish-Inspiron-3521:~/Angular$ ng serve
You seem to not be depending on "@angular/core". This is an error.
How I solved this using cmd
ashish@ashish-Inspiron-3521:~/Angular$ cd FireStore/
Now Do cmd
ashish@ashish-Inspiron-3521:~/Angular/FireStore$ ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Versions of @angular/compiler-cli and typescript could not be determined.
The most common reason for this is a broken npm install.
Please make sure your package.json contains both @angular/compiler-cli and typescript in
devDependencies, then delete node_modules and package-lock.json (if you have one) and
run
npm install again.
This happened to me when I was mixing package managers. My project was generated with Yarn, and after that, I added a couple of dependencies using npm install (this created the package-lock.json with only added dependencies).
Apparently, ng serve used package-lock.json and couldn't find Angular dependencies there. After I started using only Yarn, i.e. yarn add instead of npm install, the error was gone.
For ng serve you need to be inside that directory
How I solved this using cmd
Now Do cmd
Versions of @angular/compiler-cli and typescript could not be determined. The most common reason for this is a broken npm install.
Please make sure your package.json contains both @angular/compiler-cli and typescript in devDependencies, then delete node_modules and package-lock.json (if you have one) and run npm install again.
Delete your node modules , Check your
package.json
file should have the@angular/core
and reinstall it withnpm i
.In my case the following worked:
Hence the
npm install
, not update.Executing ng new --skip-install PROJECT_NAME and then manually going into the created folder and typing npm install. https://github.com/angular/angular-cli/issues/3906
This happened to me when I was mixing package managers. My project was generated with Yarn, and after that, I added a couple of dependencies using npm install (this created the package-lock.json with only added dependencies).
Apparently, ng serve used package-lock.json and couldn't find Angular dependencies there. After I started using only Yarn, i.e. yarn add instead of npm install, the error was gone.