npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Issue: npm errno -4094

What I Wanted to Do

I wanted to install express, which was normal until last night

What Happened Instead

I got error saying
npm ERR! code UNKNOWN
npm ERR! errno -4094
npm ERR! syscall mkdir
npm ERR! UNKNOWN: unknown error, mkdir ‘C:\Projects\redux-tutoria


Log file: 2018-09-19T03_49_03_361Z-debug.log (56.0 KB)

Platform Info

$ npm --versions
{ npm: '6.4.1',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.33.0',
  node: '10.10.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.0',
  v8: '',
  zlib: '1.2.11' }

$ node -p process.platform

Do you have anything in your package.json, for example a script, that is running a mkdir command? That’s Mac/Linux only, but you’re running Windows which doesn’t have that command.

I don’t believe this to be a problem with npm itself, but probably something within your setup or code, have a look around for any stray mkdirs.

Otherwise try reinstalling node + npm and see what happens. As for it being fine until last night, I don’t know what may have happened or changed since then so more details on that would be useful :slight_smile:

First, I’ve not installed any of the packages till then, no mkdir or any other script is being used. i’m running windows 8.1 x64.

I tried reinstalling npm + node.

Found a temporary solution,

npm cache clear --force

It helps for one install, then again for installing another packages I’ve to run the same command.

Found a permanent solution specifically for windows:

Fire up your terminal and run the following commands : npm cache verify
if you get errors then run npm cache clear --force

  1. Open ThisPC or MyComputer.
  2. Right Click on C: or the drive where node and npm is installed.
  3. Select Properties on Context Menu and goto tools tab.
  4. Select “Check” or “Check-now” under Error Checking menu.
  5. Let the process complete.
  6. Reboot your PC