Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM Install Error Woes: "npm ERR! code EINVAL"

Tags:

To begin, this all works on my OS X machine (as usual). There is something that isn't playing nice with Windows and I'd like to see if anyone has gotten anywhere with this type of error since stackoverflow seems riddled with unresolved questions on this topic.

I am having trouble with npm install on Windows 7 wherein I am using nvm for node version management windows with [email protected] and [email protected]. This EINVAL style error seems to be cropping up in various issues such as:

getting “Error: EINVAL: invalid argument, read” for “npm install --save-dev eslint --verbose” Which states the answer is to use yarn instead of npm. Another solution was to try npm cache clean which npm is telling me no longer applies above version 5.

npm installed dependencies crash ied `Error: EINVAL: invalid argument, readlink which is still unresolved.

Here is the output seeing as that the npm-debug log is a big ball of 'skipping optional dependencies' lines.

12208 verbose stack Error: EINVAL: invalid argument, utime 'E:\htdocs\pole-refactor\node_modules\.staging\lru-cache-01620014\package.json'
12209 verbose cwd E:\htdocs\pole-refactor
12210 verbose Windows_NT 6.1.7601
12211 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
12212 verbose node v8.1.2
12213 verbose npm  v5.0.3
12214 error path E:\htdocs\pole-refactor\node_modules\.staging\lru-cache-01620014\package.json
12215 error code EINVAL
12216 error errno -4071
12217 error syscall utime
12218 error EINVAL: invalid argument, utime 'E:\htdocs\pole-refactor\node_modules\.staging\lru-cache-01620014\package.json'
12219 verbose exit [ -4071, true ]

I've journeyed through various other EINVAL threads and turned up empty handed thsu far. Does anyone have any ideas I can try that we can document here?

like image 842
user2789188 Avatar asked Apr 16 '18 16:04

user2789188


People also ask

Why NPM install giving error?

code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer. This means that npm fails to install the node-sass module that's added as a dependency to the n-app project.


1 Answers

I solved the issue with message:

npm ERR! EINVAL: invalid argument, utime

doing the following steps:

npm install -g npm@latest
cd your_project_directory
rm -rf node_modules
npm install

That, basically upgrade the node package, then refresh the project's packages.

like image 147
rod.dinis Avatar answered Oct 11 '22 13:10

rod.dinis