spiffytech
spiffytech

Reputation: 6602

npm can't install local package: EISDIR: illegal operation on a directory, read

When trying to install my compiled TypeScript output as a local package via npm, I get the following error message:

$ npm install --save ../app/out

npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.

Upvotes: 1

Views: 1285

Answers (1)

spiffytech
spiffytech

Reputation: 6602

I encountered this issue when trying to npm install a local package I compiled from TypeScript. My directory structure looked like this:

app/
  package.json
  lib/
    some_code.ts
  out/
    lib/
      some_code.d.ts
      some_code.js
tests/
  package.json // npm install ../app/out

npm is complaining because ../app/out/ is a directory, not a package. I fixed this by copying app/package.json to app/out/package.json.

Upvotes: 1

Related Questions