问题
I'm using nvm to manage my node versions. My node.js executable files used to be sha bang'ed like so #! /usr/local/bin/node
but now it seems like I would have to do something like #! /Users/<userName>/.nvm/versions/node/v6.3.1/bin/node
to accomplish the same thing.
What's the best way to handle this?
回答1:
I am using #!/usr/bin/env node
in my node executable and it seems to work. There is a reference here https://en.wikipedia.org/wiki/Shebang_(Unix)#Portability
来源:https://stackoverflow.com/questions/38862171/best-way-to-make-a-node-js-file-executable-using-nvm