`npm init @scope` tries to run "create" in `$PATH`

What I Wanted to Do

Run npm init @somescope and have it work, even though I happened
to have a script in my $PATH (unrelated to npm) called create

What Happened Instead

It ran ~/bin/create and didn’t perform the normal npx behavior.

Reproduction Steps

$ echo 'echo kaboom' > ~/bin/create
$ chmod 755 ~/bin/create
$ npm init @lerna
kaboom

Details

Nothing additional.

Platform Info

$ npm --versions
{ npm: '6.11.3',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  http_parser: '2.8.0',
  icu: '64.2',
  modules: '64',
  napi: '4',
  nghttp2: '1.39.2',
  node: '10.16.3',
  openssl: '1.1.1c',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.28.0',
  v8: '6.8.275.32-node.54',
  zlib: '1.2.11' }
$ node -p process.platform
darwin

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