siliushi / VUEFormatter

formate your vue code
26 stars 5 forks source link

macOS, Node install by nvm, node path config not working. #9

Closed kerraway closed 6 years ago

kerraway commented 6 years ago

我的 node 是用 nvm 安装的

$ which node
/Users/xiaoke/.nvm/versions/node/v6.11.3/bin/node

然后我这么配置:

{
  "node_path": {
    "windows": "C:/Program Files/nodejs/node.exe",
    "linux": "/usr/bin/nodejs",
    "osx": "/Users/xiaoke/.nvm/versions/node/v6.11.3/bin/node"
  },
  // Automatically format when a file is saved.
  "format_on_save": false,
  // Only format the selection if there's one available.
  "format_selection_only": true,
  // Log the settings passed to the prettifier from `.vuebeautifyrc`.
  "print_diagnostics": true
}

然后格式化 Vue 文件时报错:

Node.js was not found in the default path. Please specify the location.

siliushi commented 6 years ago

i'm sorry, the installation path for the official download has problems and has been fed back to them. You can install it via GitHub. git clone https://github.com/baixuexiyang/VUEFormatter.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/VUEFormatter

kerraway commented 6 years ago

感谢回复,试了一下,还需要自己调整蛮多设置的,还是转回 HTML-CSS-JS Prettify 了,毕竟已经配好了。