Hey im trying to install Angular Cli but i keep getting failed package install. Then i try to start the server and it says You seem to not be depending on "@angular/core". This is an error.
相关问题
- Angular RxJS mergeMap types
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- How to update placeholder text in ng2-smart-table?
- How to instantiate Http service in main.ts manuall
- Angular: ngc or tsc?
相关文章
- angular脚手架在ie9+下兼容问题
- angular 前端项目 build 报错 "Cannot find module 'le
- Angular Material Stepper causes mat-formfield to v
- After upgrade to Angular 9 cannot find variable in
- is there any difference between import { Observabl
- Suppress “Circular dependency detected” suppress w
- How can you get current positional information abo
- Angular material table not showing data
first check the node
and npm are install correctly
then try again with
then you add it in ts file
This is how I solved this problem on my machine.
I first ran
npm install @angular/core
.Then I ran
npm install --save
.When both installs had successfully completed I ran
npm serve
and received an error sayingI then deleted my node_modules folder as well as my package-lock.json folder.
After I deleted those folders I ran
npm install --save
once more.I ran
npm start
and received another error. This error saidError: Cannot find module '@angular-devkit/core'
.I ran
npm install @angular-devkit/core --save
.Finally, I ran
npm start
and the project started!Check if you're in the project folder in terminal
First ensure you have
@angular/core
install, else run:This should get
@angular/core
install in you node_module and also update itself in yourpackage.json
. Also ensure that you're not using an old version of node and NPM, else run from your terminal:Then you can add into your js file .
How to use
Run
npm install
inside this project folder to install all dependencies.Make sure you use the latest version of the CLI (upgrade guide below)
Run
ng serve
to see the app in action (trynpm start
in caseng serve
fails).How to upgrade the CLI
Run the below commands - only use "sudo" on Mac/ Linux.
Incase if it fails too
Delete 'node_modules' folder and 'package-lock.json' file from your project directory
Run the below commands in the given order
There is some issue with node-sass in codeanywhere due to some permission exceptions. The workaround is go to /usr/lib/node_modules/@angular/cli/ and delete the node_modules folder and then run sudo npm install again create a new project using ng new and try running it . It will work