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.
Related
Npm install is not completed due to some errors.
I;m expecting the npm install successfully completed and ran this local project.
According to your error message, you need python installed.
You can install that from here. https://www.python.org/downloads/
Install python 2.7.1.
If this doesnt help, than post your package.json and your node version and the operating system where you run npm install.
And in that case, post again the error after you installed python.
also run
npm cache verify
rm -rf node_modules
rm package-lock.json // or yarn.lock if you use yarn
npm i
last will clean up your installation.
After installing python, in a new terminal. (important you open a new terminal)
python --version
npm cache clean in your terminal and please check the version of the node and angular in your machine and fix the version which matches your project then again install the npm npm i
My npm install seems to have stopped working out of nowhere, regardless of if i do npm i or npm install I keep getting an error saying npm ERR! Unexpected token '.' The other npm commands seem to be working perfectly but I can't install any modules because of this error. I'm using npm 8.7.0 and node v14.18.1
The simplest solution I could find and what worked for me was completely removing and unisntalling everything to do with nodejs and npm from my laptop. I then reinstalled it back with no issues and am able to use the command now.
As mentioned in one of the answers, try deleting the node_modules folder and package.lock.json. Use
sudo npm install
And if that doesn't work, what I would suggest is that you use yarn. If you don't know what yarn is, it's just a package manager like node.
You can install yarn by using the following command:
npm install -g yarn
After this make sure all the node modules and package.lock.json is deleted. Now run the command
yarn install
Hopefully, this will fix your issue.
npm ERR! Unexpected end of JSON input while parsing near '...--END PGP SIGNATURE--'
I keep getting this error while trying to install node-saas. I have even tried disabling anti-virus & windows defender.
I am using this command to install node sass:
npm install node-sass
Please check the below steps:
Please delete your package.lock.json file, along with that delete your node_modules folder.
Then clear all your npm cache by npm cache clean --force.
Install node-sass globally by using npm install -g node-sass
Once done with node-sass that run your npm install && npm start.
Hope this should work fine.
Why npm install does not work perfectly. When i create a new angular project and copy and paste the "src" file there, npm install works. But when I copy-paste the "package.json" same as src, npm install does not work.
This error is mentioned in the nodemon documentation:
If you see the error Cannot find module 'internal/util/types', the
error is solved with a clean npm cache and trying to reinstall the
dependency you're working with.
A start is to use the following commands:
sudo npm cache clean --force
sudo npm i -g npm
You have some missing modules in node_modules folder.
try to install with auto-install.
first install the global-cli by cmd npm install -g auto-install
then run auto-install in the directory you are working in.
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.