Global-Modules Install Error

What does this mean?

PS C:\Users\fpina> npm install global-modules
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR! syscall read
npm ERR! EISDIR: illegal operation on a directory, read

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\fpina\AppData\Roaming\npm-cache_logs\2019-08-03T12_22_39_021Z-debug.log
PS C:\Users\fpina>

Hi @MrPina! Can you attach the log file mentioned in the error message?

One reason for this error is a wrongly specified path in a configuration file or a script, but I don’t have enough info to say whether that applies to you: https://stackoverflow.com/questions/34959038/npm-stuck-giving-the-same-error-eisdir-illegal-operation-on-a-directory-read-a

Hi John,

  Here's a copy of the error log:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\fpina\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'global-modules'
1 verbose cli ]
2 info using 3 info using 4 verbose config Skipping project config: C:\Users\fpina/.npmrc. (matches userconfig)
5 verbose npm-session b0e2e62978bdff0e
6 silly install loadCurrentTree
7 silly install readLocalPackageData
8 http fetch GET 304 694ms (from cache)
9 silly pacote tag manifest for global-modules@latest fetched in 827ms
10 timing stage:loadCurrentTree Completed in 1202ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 2ms
14 silly install loadShrinkwrap
15 timing stage:rollbackFailedOptional Completed in 1ms
16 timing stage:runTopLevelLifecycles Completed in 1210ms
17 silly saveTree fpina
17 silly saveTree +-- 17 silly saveTree | `-- 17 silly saveTree | +-- 17 silly saveTree | | `-- 17 silly saveTree | +-- 17 silly saveTree | `-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree | `-- 17 silly saveTree | `-- 17 silly saveTree +-- 17 silly saveTree | +-- 17 silly saveTree | | +-- 17 silly saveTree | | +-- 17 silly saveTree | | `-- 17 silly saveTree | | `-- 17 silly saveTree | +-- 17 silly saveTree | `-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree | `-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree +-- 17 silly saveTree `-- 18 verbose stack Error: EISDIR: illegal operation on a directory, read
19 verbose cwd C:\Users\fpina
20 verbose Windows_NT 10.0.18362
21 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\fpina\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "global-modules"
22 verbose node v12.7.0
23 verbose npm v6.10.2
24 error code EISDIR
25 error errno -4068
26 error syscall read
27 error EISDIR: illegal operation on a directory, read
28 verbose exit [ -4068, true ]

In Administrative Mode in Windows PowerShell:

PowerShell 7.0.0-preview.2
Copyright © Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type ‘help’ to get help.

PS C:\Windows\System32> npm install global-modules
npm WARN system32@1.0.0 No description
npm WARN system32@1.0.0 No repository field.

  • global-modules@2.0.0
    removed 3 packages, updated 1 package and audited 10497 packages in 5.183s
    found 1 high severity vulnerability
    run npm audit fix to fix them, or npm audit for details
    PS C:\Windows\System32> npm audit fix
    npm WARN system32@1.0.0 No description
    npm WARN system32@1.0.0 No repository field.

removed 3 packages in 2.769s
fixed 0 of 1 vulnerability in 10497 scanned packages
1 vulnerability required manual review and could not be updated
PS C:\Windows\System32>

  1. An observation, but I don’t know your setup. It looks like in the first case you are installing directly into your home folder, and in the second case you are installing to C:\Windows\System32.

Normally you create a new folder for the package you are developing and install to there. These are unix instructions sorry, but hopefully show the idea:

mkdir MyProject
cd MyProject
npm init
npm install global-modules
  1. Given it worked in Administrative Mode (good test), I suspect your personal configuration file.

What is in this file: C:\Users\fpina/.npmrc ?

Okay, how’s this?

  PowerShell 7.0.0-preview.2

  Copyright (c) Microsoft Corporation. All rights reserved.

  Type 'help' to get help.

PS C:\Users\fpina> cd
C:\Users\fpina\PhpstormProjects\Fotographer.online
PS C:\Users\fpina\PhpstormProjects\Fotographer.online> npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible
defaults.
See npm help json for definitive documentation on these fields
and exactly what they do.
Use npm install <pkg> afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (html5-boilerplate)
version: (7.1.0)
entry point: (.eslintrc.js)
keywords:
author:
license: (MIT)
About to write to
C:\Users\fpina\PhpstormProjects\Fotographer.online\package.json:
{
“devDependencies”: {
“apache-server-configs”: “^3.2.1”,
“archiver”: “^3.0.0”,
“babel-core”: “^6.26.3”,
“babel-preset-env”: “^1.7.0”,
“babel-register”: “^6.26.0”,
“del”: “^4.1.1”,
“eslint”: “^5.16.0”,
“eslint-config-recommended”: “^4.0.0”,
“eslint-plugin-mocha”: “^5.3.0”,
“glob”: “^7.1.4”,
“gulp”: “^4.0.2”,
“gulp-autoprefixer”: “^6.1.0”,
“gulp-eslint”: “^5.0.0”,
“gulp-header”: “^2.0.7”,
“gulp-jscs”: “^4.1.0”,
“gulp-load-plugins”: “^1.6.0”,
“gulp-rename”: “^1.4.0”,
“gulp-replace”: “^1.0.0”,
“jquery”: “3.4.1”,
“main.css”: “2.0.0”,
“mocha”: “^6.1.4”,
“modernizr”: “3.7.1”,
“normalize.css”: “8.0.1”,
“run-sequence”: “^2.2.1”,
“ssri”: “^6.0.1”,
“strip-json-comments”: “^3.0.1”,
“webpack”: “^4.34.0”,
“yarn”: “^1.16.0”
},
“engines”: {
“node”: “>=6”,
“npm”: “>=3”
},
“babel”: {
“presets”: [
“env”
]
},
“h5bp-configs”: {
“directories”: {
“archive”: “archive”,
“dist”: “dist”,
“src”: “src”,
“test”: “test”
}
},
“homepage”: ,
“license”: “MIT”,
“name”: “html5-boilerplate”,
“scripts”: {
“build”: “gulp build”,
“test”: “gulp archive && mocha --require
babel-core/register --reporter spec --timeout 5000”
},
“version”: “7.1.0”,
“description”: “A professional front-end template for building
fast, robust, and adaptable web apps or sites.”,
“files”: [
“CHANGELOG.md”,
“LICENSE.txt”,
“package.json”,
“dist/”,
“modernizr-config.json”,
“README.md”
],
“repository”: {
“type”: “git”,
“url”: “git+https://github.com/h5bp/html5-boilerplate.git”
},
“dependencies”: {
“js-yaml”: “^3.13.1”,
“lodash”: “^4.17.11”
},
“bugs”: {
“url”: },
“main”: “.eslintrc.js”,
“directories”: {
“test”: “tests”
},
“author”: “”
}
Is this OK? (yes)
PS C:\Users\fpina\PhpstormProjects\Fotographer.online> npm
install global-modules
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform
for : wanted {“os”:“darwin”,“arch”:“any”} (current:
{“os”:“win32”,“arch”:“x64”})

  • added 2 packages from 9 contributors, updated 2 packages and
    audited 17514 packages in 12.351s
    found 407 vulnerabilities (3 low, 1 moderate, 403 high)
    run npm audit fix to fix them, or npm audit for details
    PS C:\Users\fpina\PhpstormProjects\Fotographer.online> npm
    audit fix
    npm WARN rollback Rolling back failed (this
    is probably harmless): EPERM: operation not permitted, lstat
    ‘C:\Users\fpina\PhpstormProjects\Fotographer.online\node_modules\fsevents\node_modules’
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform
    for : wanted {“os”:“darwin”,“arch”:“any”} (current:
    {“os”:“win32”,“arch”:“x64”})
  • removed 2 packages and updated 4 packages in 9.817s
    fixed 396 of 407 vulnerabilities in 17514 scanned packages
    11 vulnerabilities required manual review and could not be
    updated
    PS C:\Users\fpina\PhpstormProjects\Fotographer.online>

Okay, still nothing…

  PowerShell 7.0.0-preview.2

  Copyright (c) Microsoft Corporation. All rights reserved.

  Type 'help' to get help.

PS C:\Users\fpina> npm outdated
Package Current Wanted Latest Location
d 1.0.0 1.0.1 1.0.1 global
global-modules 1.0.0 1.0.0 2.0.0 global
graphql 14.1.1 14.4.2 14.4.2 global
vue 2.6.8 2.6.10 2.6.10 global
PS C:\Users\fpina>

Has the EISDIR error gone away?

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