Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "Node.js was not found in the default path. Please specify the location." #1

Open
superphly opened this issue Mar 1, 2017 · 7 comments

Comments

@superphly
Copy link

It then opens the 'solium-gutter.sublime-settings' file and the path is correct, I verified it thoroughly. I save the file, close it and it still gives me the error.

@sey
Copy link
Owner

sey commented Mar 2, 2017

When you open the Sublime Text console (ctrl + ` on mac), you should see what path the plugin uses for node and on which platform you are when you save a Solium file.
It looks like something like:
Using node.js path on 'osx': /Users/florian/.nvm/versions/node/v6.10.0/bin/node
Can you share this with me?

@sey
Copy link
Owner

sey commented Mar 17, 2017

Any news?

@yxliang01
Copy link

Same here. After spent few minutes to read through some code, I realized that it should be that (if I am not mistaken) the solium has some error, and whenever error is occured, your plugin will just prompt that nodejs is not found.

Using node.js path on 'windows': C:\Program Files\nodejs\node.exe
b"SUBLIME_PATH\\Data\\Packages\\Solium Gutter\\scripts\\node_modules\\solium\\lib\\rules.js:128\r\n\t\t\t\tthrow new Error ('Rule ' + ruleName + ' was not found');\r\n\t\t\t\t^\r\n\r\nError: Rule pragma-on-top was not found\r\n    at SUBLIME_PATH\\Data\\Packages\\Solium Gutter\\scripts\\node_modules\\solium\\lib\\rules.js:128:11\r\n    at Array.forEach (native)\r\n    at Object.load (SUBLIME_PATH\\Data\\Packages\\Solium Gutter\\scripts\\node_modules\\solium\\lib\\rules.js:126:27)\r\n    at EventEmitter.lint (SUBLIME_PATH\\Data\\Packages\\Solium Gutter\\scripts\\node_modules\\solium\\lib\\solium.js:69:31)\r\n    at fs.readFile (SUBLIME_PATH\\Data\\Packages\\Solium Gutter\\scripts\\run.js:48:29)\r\n    at tryToString (fs.js:449:3)\r\n    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436:12)\r\n"
None
Unexpected error(<class 'AttributeError'>): 'NoneType' object has no attribute 'find'
error: You won't be able to use this plugin without specifying the path to node.js.
Traceback (most recent call last):
  File "SUBLIME_PATH\sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "SUBLIME_PATH\Data\Packages\Solium Gutter\solium-gutter.py", line 36, in run
    for line in output.splitlines():
AttributeError: 'NoneType' object has no attribute 'splitlines'

@domtancredi
Copy link

So what's the solution to this? Solium gutter is broken?

@skozin
Copy link

skozin commented Mar 31, 2018

Looks like this. I'm getting the same error, and looking in console reveals this:

Using node.js path on 'osx': /usr/local/bin/node
b"/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:79\n\t\t\t\tthrow new Error (\n\t\t\t\t^\n\nError: A valid definition for rule 'quotes' not found. Description:\nTypeError: Cannot read property 'verify' of undefined\n    at /Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:75:10\n    at Array.forEach (<anonymous>)\n    at EventEmitter.lint (/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:71:37)\n    at fs.readFile (/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/run.js:48:29)\n    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:532:3)\n    at /Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:79:11\n    at Array.forEach (<anonymous>)\n    at EventEmitter.lint (/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:71:37)\n    at fs.readFile (/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/run.js:48:29)\n    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:532:3)\n"
None
Unexpected error(<class 'AttributeError'>): 'NoneType' object has no attribute 'find'
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/solium-gutter.py", line 36, in run
    for line in output.splitlines():
AttributeError: 'NoneType' object has no attribute 'splitlines'

It seems like this is the source of the error (the second line in the output above):

/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:79
throw new Error (
^

Error: A valid definition for rule 'quotes' not found. Description:
TypeError: Cannot read property 'verify' of undefined
    at /Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:75:10
    at Array.forEach (<anonymous>)
    at EventEmitter.lint (/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:71:37)
    at fs.readFile (/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/run.js:48:29)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:532:3)
    at /Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:79:11
    at Array.forEach (<anonymous>)
    at EventEmitter.lint (/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/node_modules/solium/lib/solium.js:71:37)
    at fs.readFile (/Users/me/Library/Application Support/Sublime Text 3/Packages/Solium Gutter/scripts/run.js:48:29)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:532:3)

I use Solium v1.1.6, and my .soliumrc.json is this:

{
  "extends": "solium:all",
  "plugins": ["security"],
  "rules": {
    "quotes": ["error", "double"],
    "indentation": ["error", 2],
    "security/enforce-explicit-visibility": ["error"]
  }
}

I think it fails because sublime-solium-gutter uses its own version of Solium, which is outdated. Is there a way to make it use locally-installed Solium from node_modules?

@ambiflextrous
Copy link

Same problem here. Any solution?

@rudza
Copy link

rudza commented Jun 29, 2018

Anu update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants