Best way to make a node.js file executable using nvm

大城市里の小女人 提交于 2019-12-23 09:39:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!