EINVAL: invalid argument, read

cli
help-wanted
priority:medium
triaged

(Spencer) #1

I’m getting a really annoying error that’s preventing me from installing most packages. Some random person on stackoverflow solved their related issue with deleting node_modules but that doesn’t help me. Forcefully clearing or repairing npm cache also does not help at all.

H:\projects\node\webserver>npm i --save @arcticzeroo/webserver-module-msu
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\Spencer\AppData\Roaming\npm-cache\_logs\2018-07-14T19_20_19_084Z-debug.log

This has only started happening in the past few months.

2018-07-14T19_20_19_084Z-debug.log (759.6 KB)
This is the referenced log file.

There are definitely a lot of packages in this project, but I can’t even install simple stuff. Running npm i --save-dev eslint @arcticzeroo/eslint-config fails in https://github.com/ArcticZeroo/webserver-module-msu after either has been installed once before for me.

npm is pretty much unusable for me right now, and I have to use yarn to install modules. Which sucks because yarn is also weird and runs extra random commands from my package.json after I install things…


(Kat Marchán) #2

Lemme take a look. This looks like a legit bug.


(Spencer) #3

Thank you! I would also like to note that it appears to be version-agnostic, for both npm and node. I’ve had it happen on node v8, 9, 10, and npm v5.6 through latest. (it could have been happening before any of those, that’s just the range on which I have tested)


(Kat Marchán) #4

I snooped around a bit and couldn’t track down the error. There’s definitely something weird going on and this definitely seems like a bug (so I’m gonna move it to #bugs). I would really appreciate if you edited the OP to fit into the bug report template after I do that, 'cause it’ll be easier to scan. It sounds like you have a repro that works for you so that’s great. I’ll try the repro myself on Windows on Monday and see how it goes (it’s a weekend, I’m not really working but I wanted to check something hadn’t gone horribly wrong with yesterday’s release).

For the time being, take a look at:

I suggest you try installing both node and npm entirely, and then do an install and do the upgrade doing npm-windows-upgrade. The node.js installer does… things that break npm sometimes, and I wanna make sure your install itself is working, in case that gets you going. It’s a bit of a stretch, but it’s what I’ve got for you right now. :green_heart:


(Spencer) #5

Neither of those things helped, unfortunately :frowning:

I’m unsure if the repro is specific to my system, but yeah it’s very easy to reproduce since it happens with most modules haha.

It’s not related to yesterday’s release, so no worries there. I’ve had this issue for a while and just decided to post an issue about it.

I will format it into a bug in a moment.

edit: I’m receiving an error when I attempt to do so, and it provides no extra info, so no bug formatting for now unfortunately :(


(system) #6

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


(Kat Marchán) #7

(Kat Marchán) #8

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


(Kat Marchán) #9

(Spencer) #10

I’m still getting that error unfortunately – some random answer on stackoverflow seemed to correlate it with the fact that someone else was installing onto a flash drive formatted with exFAT rather than NTFS (which is my case as well).

Deleting node_modules and package.json fixes it for a single run of the npm install