ts-protoc-gen icon indicating copy to clipboard operation
ts-protoc-gen copied to clipboard

"npm --prefix ./path install ./path" installs binary files under ./path rather than ./path/node_modules/.bin

Open zzwx opened this issue 3 years ago • 2 comments

Versions of relevant software used 0.14.0

What happened I'm trying to automate stuff from another directory.

What you expected to happen protoc-gen-ts protoc-gen-ts.cmd protoc-gen-ts.ps1

should appear under node_modules/.bin instead of project directory.

How to reproduce it (as minimally and precisely as possible):

npm --prefix ./path install ./path without node_modules

Also repeated attempts to do the same lead to

npm ERR! code EEXIST
npm ERR! path "PATH"\node_modules\ts-protoc-gen\bin\protoc-gen-ts
npm ERR! dest "PATH"\protoc-gen-ts.cmd
npm ERR! EEXIST: file already exists, cmd shim '"PATH"\node_modules\ts-protoc-gen\bin\protoc-gen-ts' -> "PATH_TWO_LEVELS_UP"
\grpc\grpcwebclient\protoc-gen-ts.cmd'
npm ERR! File exists: PATH\protoc-gen-ts.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

(Where PATH and PATH_TWO_LEVELS_UP are project-dependent with PATH_TWO_LEVELS_UP being 2 levels up from PATH)

Environment:

  • OS: Windows 10

zzwx avatar Mar 27 '21 20:03 zzwx

yarn --cwd ./path works as intended. So it might be an npm bug.

zzwx avatar Mar 29 '21 17:03 zzwx

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 17 '22 07:04 stale[bot]