Issues installing NPM packages

I keep trying to install NPM packages into my React app (specifically axios so I can run a firebase database), but I am always met with :

PS D:\coding\Udemy\burger_builder> npm install axios
npm ERR! code EINVAL
npm ERR! EINVAL: invalid argument, read

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mokry\AppData\Roaming\npm-cache_logs\2019-08-02T15_35_32_619Z-debug.log

I have a second computer that I was originally working on that doesn’t run into these errors, but on my current computer all I have are these errors regardless of what npm package I try to run.

I’ve already tried uninstalling and re-installing node and npm, but the result is still the same. Does anyone have any idea? I’d really appreciate some help!

The most likely cause is the file system. Are you installing on a USB stick or flash drive? Can you install normally on your C drive?

A less common cause I saw is a problem the cache, but that may have been with older versions of npm. You can check the cache with:

npm cache verify

I am actually trying to keep all my code on an external SSD so as to keep my computer clear of extra clutter. Didn’t realize that trying to run npm install on an external drive would cause all these problems. Is there any way I can make it so that I can run npm installs on the SSD? If it helps, this is the SSD I’m using to store my code: Samsung T5 SSD

Would something like this make sense to do: Install Node.js on a different hard drive from C to D

Is your external SSD currently formatted as exfat?
If so, is it an option to try reformat as NTFS?
(nb: NTFS is supported by less operating systems than exfat, so may not suit if you want to connect drive to non-Windows computers)

NTFS might work. Based on reading the links I supplied, I have no personal experience, so make your own decision about work required to try this and the trade-offs!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.