npm Community Forum (Archive)

The npm community forum has been discontinued.

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

6.11.0: NPM looking for executable packages in root C:\

What I Wanted to Do

Run an executable with npx or in a script via npm run ...

What Happened Instead

'find_dp0' is not recognized as an internal or external command,
operable program or batch file.
    throw err;

Error: Cannot find module 'C:\<scope>\<package>\index.bin.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Reproduction Steps

On windows, upgrade from 6.10.3 to 6.11.0 via npm install -g npm

run a package with npx <package> or inside of a package.json script, such as prepare


I tried reinstalling, but had the same issue.
Downgrading back to 6.10.3 via npm install -g npm@6.10.3 fixed the issue.
I was able to install a package via npm install -g <package> and run it in the console, but still could not run it as described here.

Was not able to re-upgrade to 6.11.0

npm ERR! code EEXIST
npm ERR! path C:\Users\xxx\AppData\Roaming\npm\npx.cmd
npm ERR! Refusing to delete C:\Users\xxx\AppData\Roaming\npm\npx.cmd: is outside C:\Users\xxx\AppData\Roaming\npm\node_modules\npm and not a link
npm ERR! File exists: C:\Users\xxx\AppData\Roaming\npm\npx.cmd
npm ERR! Move it away, and try again.

Platform Info

after downgrade back to 6.10.3, was unable to re-upgrade after downgrade.

$ npm --versions
{ npm: '6.10.3',
  ares: '1.15.0',
  cldr: '33.1',
  http_parser: '2.8.0',    
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',       
  node: '10.15.3',
  openssl: '1.1.0j',       
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '',
  zlib: '1.2.11' }
$ node -p process.platform

I have the same problem. npm.cmd at the prefix location is not the same file as the one in the bin folder.

If someone has to use 6.11.0, simply copy the file npm.cmd from node_modules\npm\bin over the the file in your prefix location.

In an effort to duplicate this, I needed to manually delete the AppData/Roaming/npm directory and reinstall nodejs.
Afterwards, steps I took:

So that worked from a fresh install.
In an effort to try other things, I attempted to downgrade again using npm install -g npm@6.10.3, but this failed just like the original issue. Might warrant a new issue.

npm ERR! File exists: C:\Users\xxx\AppData\Roaming\npm\npm.cmd
npm ERR! Move it away, and try again.

In the mean time, I’ll reinstall from scratch again and attempt to duplicate after an npm install of a local package’s dependencies.

After another fresh install of 6.11.0, I attempted to run npm install in a package that has a prepare script. This resulted in the same errors as the original issue.
If I then try to run npm run prepare manually, I have the same errors.

Steps in order:

Not sure if also helpful:

Hey @krumware,

We appreciate you flagging this! @isaacs investigated further and just now tagged and released an update (v6.11.1). You can read more about the fix here.

Please update accordingly (ie. npm i -g npm) and let us know if you are still experiencing any problems.

Thanks @darcy, I can confirm that 6.11.1 is working!

FYI this is also being updated in the latest NodeJS version due on Sept. 3rd