mihai-vlc / sublime-jsfmt

jsfmt plugin for Sublime Text
MIT License
477 stars 21 forks source link

Error: 'node' is not recognized as an internal or external command #53

Closed congson95dev closed 6 years ago

congson95dev commented 6 years ago

hi . i have an trouble , why this appear in console and how to fix it?

"Error: 'node' is not recognized as an internal or external command, operable program or batch file."

it appear when i set auto format : on , and try to save javascript code thanks

mihai-vlc commented 6 years ago

Can you please ensure that the path to the nodejs executable file is configured in your settings

{
    "node-path": "node"
}

You should find that under Preferences > Package settings > Sublime JSFMT > Settings – User

you can use settings default as an example

mihai-vlc commented 6 years ago

Please reopen the ticket if this doesn't fix your issue.

congson95dev commented 6 years ago

{ "autoformat": true, "node-path": "node", } i do this but still not working .. same problem still appear.

mihai-vlc commented 6 years ago

for the node-path parameter can you try to add the full path to the node executable file ?

congson95dev commented 6 years ago

hmm .. i added everything from default to user but still not work

`{ // autoformat on save "autoformat": true,

// array of extensions for autoformat
"extensions": ["js", "sublime-settings"],

// options for jsfmt
"options": {
    "preset": "jquery",
    "indent": {
        "value": "    "
    },
    // plugins included
    "plugins": [
        // "esformatter-quotes",
        // "esformatter-semicolons",
        // "esformatter-braces",
        // "esformatter-dot-notation"
    ]
},
"options-JSON": {
    "plugins": [
        "esformatter-quotes"
    ],
    "quotes": {
        "type": "double"
    }
},
"node-path": "node",
"alert-errors": true,
"ignore-selection": false

}`

mihai-vlc commented 6 years ago

The absolute path to your node executable file should be something like: C:/Program Files/nodejs/node.exe

congson95dev commented 6 years ago

doesn't seem like i have it C:/Program Files/nodejs/node.exe

mihai-vlc commented 6 years ago

Maybe you haven't installed nodejs yet ? https://nodejs.org/en/