How to get the npm global path prefix

前端 未结 2 540
臣服心动
臣服心动 2020-12-04 18:47

I believe that in the past I\'ve discovered an option to pass to npm to get it to output the path it is using for -g (global modules). Does anyone

相关标签:
2条回答
  • 2020-12-04 19:25

    How about npm bin?

    It can be used with export PATH="$(npm bin):$PATH". It will find npm's bin global directory (or if exist: local).

    0 讨论(0)
  • 2020-12-04 19:36

    npm config get prefix will return the path.

    0 讨论(0)
提交回复
热议问题