JavaScript User Authentication With Express and Mongo User Registration Setting Up Mongoose and a Mongo Database

Osaro Igbinovia
Osaro Igbinovia
Full Stack JavaScript Techdegree Student 15,917 Points

How can I install the mongoose package?

I've been following the instructions from the tutor since the S1V4 folder so there was no need to navigate to S2V3 folder but still I get this error in my terminal whenever I attempt to install mongoose. I'm using Windows Powershell in my Atom text editor on windows 8.1 Pro by the way.

The error I get in my terminal:

PS C:\Users\Osaro\Desktop\S1V4> npm install mongoose --save

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

npm ERR! A complete log of this file can be found in:

npm ERR! C:\Users\Osaro\AppData\Roaming\npm-cache_logs\2017-11-07T17_13_36_363Z-debug.log

Keep in mind that I've install node, npm and MongoDB on my PC.

2 Answers

Hello,

Check if your npm is uptodate - npm-windows-upgrade --npm-version latest - and run one more time - npm install mongoose -

Osaro Igbinovia
Osaro Igbinovia
Full Stack JavaScript Techdegree Student 15,917 Points

My npm is up to date. There was a solution to the problem on Stack Overflow. All I had to do was type 'npm clear cache' in my Atom terminal. Oh yeah I also had to add the 'force' flag. So I typed ' npm clear cache --force' in my terminal and then installed the mongoose successfully.

Ok, I had that kind of error, sometimes it's easy to solve, sometimes more tricky. Great you found by yourself.