Can't run Angular application with ng serve - node.js

enter image description here
Hi.
I can't build and run my Angular application. I tried to reinstall angular/cli, node.js and remove all node modules packages globally but it did not help.

try to do:
npm install
if the error persist you can do
npm install jquery --save

If the error still happens after npm install, try deleting the whole node_modules folder and run npm install again.

Related

npm WARN deprecated #npmcli/move-file#2.0.1: This functionality has been moved to #npmcli/fs

While installing Angular cli using the command:
npm install -g #angular/cli
I am getting this warning.
I am using node version 16.17.0 and npm version 8.19.2
I wanted to install angular cli. But ng command not working
Try the command 'ng v' and check if it asks any question about sharing data about this project with the Angular Team at Google google or any question at all about google say N as no. If it shows angular versions then it means angular/cli is installed
To solve this problem perform following steps:
npm uninstall -g #angular/cli
npm cache clean --force
npm cache verify
npm install -g #angular/cli
ng version
After this moment if you see that powershell is not allowing to execute the script
follow following steps from this site:
Chaman Gautam
and then run ng version(or any ng command you will be able to)
if you see angular
you are good to go !!!
I had the same problem recently. I tried uninstalling angular and reinstalling it but there were already 'ng' files at the location:
C:/Users/<your_user_name>/AppData/Roaming/npm
To resolve the issue, go to that npm folder and delete the following files:
ng
ng.cmd
ng.ps1
Once these files are removed, reinstall angular cli. Follow the guide here to clear the cache and do a clean install:
[https://www.javatpoint.com/uninstall-and-reinstall-angular-cli][1]
The ng command should work now. Check with the below command
ng --version
References:
[1]: https://www.javatpoint.com/uninstall-and-reinstall-angular-cli

Unable to add firebase to react app with "npm install firebase"

I am trying to add firebase to my react app.But when I type npm install firebase I get strange error like:
Unexpected end of JSON input while parsing near 'Error message '. Error message is different every time i run npm install firebase.I have looked this questions:
Firebase npm install error
Unable to do "npm install --save firebase"
Firebase - Failing to install firebase using npm but yarn works
I have tried npm cache clean --force,and after npm update ,but that didn't work.Also I have tried downgrading npm,but that either did not work.Also I have tried uninstalling node,and installing again ,but that did not help either.Thanks in advance
npm version 6.13.7
node version v12.19.0
How about just to be sure remove package-lock.json and delete node_modules folder with rm -rf node_modules?
And after that npm install again.
Good luck.
It looks like npm cache was corrupted ,but as npm cache clean --force did not work,deleting _cacache directory in C:\Users\User\AppData\Roaming\npm-cache solved my problem.After that npm install worked just fine.

I am getting this error when I try to run react app with npm?

Getting this error when trying to run the react app with expo,
Tried running npm install expo-cli --global and also has package.json file.
I'd suggest using yarn. it's much better than npm.
I was having a lot of problems with npm as well when I try to run the app or install any packages.
install yarn using
npm install yarn -g

Error: Cannot find module '…/webpack' Vue js

npm run build throwing error. Where is the problem?
Used
npm install --save-dev webpack
npm install --save-dev webpack-dev-server
I'ts not working, any idea?
Try to delete node_modules directory and then run npm install and then try tu use npm run build let me know if it works
Just do this.. if you want to clean up the webpack package entirely from Vue
Delete the node_modules
Delete the package-lock.json
npm install
npm run build

Unable to start angular4 app using ng serve

I am executing following command in my angular 4 app,
ng serve
But i am getting the following error message,
This version of CLI is only compatible with angular version 2.3.1 or
better. Ple ase upgrade your angular version, e.g. by running:
npm install #angular/core#latest
my angular cli version is 1.6.8.
Even i executed the above mentioned command to update my angular cli, but still same error is getting reported.
Perform Following steps:
1. perform npm cache clean --force
2. Reinstall Angular CLI globally using following command:
npm install -g #angular/cli
3. Delete 'node modules folder' and perform npm install for your project and try running it with npm start/ng serve
From the github issue here: https://github.com/angular/angular-cli/issues/5558
The project needs a dev dependency for #angular/compiler-cli.
npm install --save-dev #angular/compiler-cli#<your angular version>
If that doesnt work you can try this:
npm install --save-dev #ngtools/webpack#1.2.13
One of the main contributors of angular-cli said that it is an issue with older webpack versions, reading the github thread should provide some more insight
To resolve the angular cli error, please try following steps :
npm uninstall —save #angular/cli
npm cache clean
npm install —save #angular/cli

Resources