unable to install firebase using npm - node.js

Hi I am following a tutorial using firebase (its quite an old version) when I try to install firebase it will not install as all.
I am using npm install firebase#4.13 --save, i have also used npm install firebase#4.13 --save --force -g but get the same issue.
I have tried to clean the cache using npm cache clean --force.
below is my full error report, could someone please help with this as I really have no idea why this is happening.
Thanks
I have tried:
uninstalling node and reinstalling
cleaning the cache
different npm install statements
restarting the project again
I can provide the error report but it is 1644 lines long so it wont allow me to post it with this.

Related

Error: Can't update or reinstall my node modules

I recently updated my Node and now whenever I try to update the node modules of this project I get errors. This is the only project that gives issues with it, all the other once are fine.
I tried removing the node module's and the react-countdown-clock in the package.json, I also tried copying the files to see if i could find the problem. But with everything I tried I still got the error's. So I was wondering if anyone has any advice for me how to fix it.
Execute below Commands
npm install -g npm-check-updates
ncu -u
npm install
npm start

npm ERR! Unexpected end of JSON input while parsing near '

So this error randomly popped up while I was working on my project:
I've searched online and most of the answers ask to run npm cache clean --force.
This did not work for me :(
I've also tried to reinstall npm but still get the same error.
Here is the error-log:
I've been stuck on this for a while hoping someone can help me out :/
You should try to reinstall entirely nodejs from your computer. This could solve the problem.
sudo apt-get remove nodejs
sudo apt-get install nodejs
You can try "yarn" instead of npm.
Installation (If you are using Mac):
brew install yarn
Or check here
https://classic.yarnpkg.com/en/docs/install/
Then just run (Works like "npm install")
yarn
try npm cache clean --force, fixed the issue for me.
ref: npm-err-unexpected-end-of-json-input-while-parsing-near-743
For my Vue.js project this problem was solved by first deleting the package-lock.json file and then running npm install
Comment from #user2864740 helped point me in this direction, thank you!

node js npm package installation not completed

I try to install node js npm packages, but It start to install and unfortunately freezes. I also try to install angular packages and it doesn't any problem. please help to fix this issue.
node version is 12.13.1;
npm version is 6.12.1;
I tried to install packages this way
npm i html-to-xlsx
here is a result:
another installation result:
Try the following commands then re-run the command:
npm cache clean --force
npm cache verify
And make sure you are in a place with good internet connection. Sometimes this is the issue.
I found way to fix this issue. I add -g before package name
npm install -g html-to-xlsx
Everything looks good
After that I enter this path C:\Users{USERNAME}\AppData\Roaming\npm\node_modules and copy needful module into my working folder

Not able to install #angular/cli using npm

I am new to "#angular/cli", I have tried every thing but could not install.
I am tired now please some one can help me to install angular 4 "#angular/cli" in my system.
node and npm Version
and when I am installing "npm install -g #angular/cli" then getting
after installing node -v 6 I am getting below erorr
please suggest me where actually I am wrong.
My friend,
Please try: npm cache clean --force. Maybe your npm cache got confused.
It could be issue with your node version. I will suggest you to reinstall node and try it again.
Or you can also try to clean node cache of using npm cache clean --force
List of Npm registry
https://registry.npmjs.org/ (Dfault One)
https://r.cnpmjs.org/
https://registry.npm.taobao.org/
https://registry.nodejitsu.com/
https://skimdb.npmjs.com/registry
To switch just type
npm config set registry "https://registry.npmjs.org/"
Replace the registry url with the above urls check which one works for you.
I am from india so i used https://r.cnpmjs.org/ and the same error got resolved.
Note: Please use npm cache clear (To clear cache ) and npm cache verify (To verify its clear or not), This Method works for me
Changing Registry location worked for me .
Using :
npm config set registry "https://registry.npmjs.org/"
few warnings but meh! life's too short for warnings.(Every thing is working fine BTW)
It is possible your npm cache has a corrupted file, perhaps it partially downloaded something and then got an error. Try npm cache clean --force and see if that helps.
If that doesn't help look in the log file given in the error message. Find the unexpected end of JSON input message in the log file and look before it to see if there are any other hints to the problem.
You updated your question with a new error message. That one is more specific about the corrupted file. Try removing the cli-1.5.5.tgz file from the path specified and try again. If you are using a web proxy on your network then it is also possible that your proxy has stored a corrupted cache: if you are able then turn off any proxies configured for your system and try a direct download.
Perhaps you are missing space- npm install -g #angular/cli#latest
1) Install node.js and check and node -v in command prompt. (Node.js
through website).
2) npm install -g #angular/cli#latest (run in command prompt).
Refer this link for further help
https://github.com/angular/angular-cli
3) Check node -version
4) Check npm -version
5) check ng -version
If already installed, then uninstall it and install again,
npm uninstall -g #angular/cli
npm cache clean
Both the CLI and generated project have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.
Try using different Node version.
First try updating NodeJS(8.9.3) and npm(5.6.0). These are the LTS versions. For Node this can be important! If that doesn't work, follow this installation guide for windows.
Make sure you are not connected to VPN while installation is on.
Also, please cleanup your node_modules folder before your next try. I use the command rimraf node_modules to remove this directory in windows.
Lastly try running npm install -g #angular/cli#latest
run npm install -g #angular/cli#latest in command prompt as an admin.
right click the windows button, click on command propmt (Admin) or windows power shell(Admin) depending on your windows version. Then type the command and run it.
Most times, you could get issues when you want to install as a normal user considering the fact that you are using the -g (global) flag.
We too have the same kind of issue with user login then we tried from Administrator login its worked for us. Please do the same it may fix for you too.
Please try running:
rm -rf node_modules package-lock.json
And this,
npm install
If it still does not work, try to manually install cli:
npm install --save-dev #angular/cli
When an npm package is published, the publishing process generates a checksum that npm uses at install time to verify that the package didn't get corrupted in transit.
I had the exact same problem, while i was working in a client site, so the problem could be not your environment, they may have a proxy that needs to be configured, in my case we had a nexus server we were going through, and it has something wrong, but when i started using npm registry directly everything worked fine, but most of the time it's a cache problem, to be sure of that you should run:
npm doctor
you will probably find where is the issue.
if not please post the result maybe i can help.
Make sure your console is running as Admin,
Reinstall node & npm
Reinstall angular/cli
Most probable issue is with npm cache. Just clean your npm cache by command
npm cache clean --force
It should work well.
Uninstall your node package. And try the following
Install the latest node package from
https://nodejs.org/en/download/
Check your node and npm version by
node -v
npm -v
Now install the Angular latest version by
npm install -g #angular/cli
Check the angular version by
ng v
Now start creating your application from
https://angular.io/guide/quickstart
So I'm working with Hyperledger which requires you to have a certain Node version 8 and therefore you cannot use the newest angular installation. Perhaps I can recommend another alternative?
cd into the directory
npm install
npm start
You can also clean your npm cache but if one way doesn't work, try the other.
Try navigating to /usr/local/bin and :
if check if the file named ng is present over there, if yes then
rm -r ng and it will remove that file.
Then you can try sudo npm i -g #angular/cli#latest
And it will be a successful install.
(Writing this for those who might also face this issue in future)
Npm cache clean --force
Then install npm
Then go for angular
Npm I -g #angular/cli
was having a similar issue while installing angular cli using npm.
this was resolved by running:
npm cache clean --force
It happened to me once, looked like I had to specify the version of angular cli:
https://github.com/angular/angular-cli/issues/11589
e.g.:
npm install -g #angular/cli#1.5.0
It could be issue with your node version. I will suggest you to reinstall node and try it again.
Or you can also try to clean node cache of using npm cache clean --force
Please check this also Perhaps you are missing space- npm install -g #angular/cli#latest

npm peerDependencies React : can't install any packages

I'm building new React App to learn and play with Draft-js, RichStyle Text Editor.
I used create-react-app to initialize my React application. It's working, and very easy to use.
Now, I tried to add semantic-ui-react, which is React version of SemanticUI lib.
Aaaaannd fail.
npm install semantic-ui-react --save
As you can see, same effect for draft-js.
My issue is that normally there's no problem to use draft-js & semantic-ui-react with React 15.4.2. I use this stack in professional env.
Is there something I'm missing with npm ? Is create-react-app can stop this install ?
Now, I can't install any packages. This error shows up everytime. But, I cant still npm start for my local web server. I also tried npm cache clean
Is my very simple package.json
Thanks again for you help.
Solution : Just update NPM and everything working.
Edit : My App folder :
And my npm & node version
My guess is that you have old npm or node versions, you can't start the project with this versions... you can upgrade npm and node programs.
if you are using brew on OSX then you can use following commands to upgrade them.
brew update
brew upgrade node
npm install -g npm

Resources