Closed programmist closed 6 years ago
Maybe your node_modules pass does not match. You can check your global node_modules path by
$ npm root -g
command. and try set your sublime eslint's "node_modules_path"
to displayed path.
Thank you. I checked both both paths before setting them in Sublime. When I run npm root -g
I get
/usr/local/lib/node_modules
, which is what I have set for node_modules_path
.
Does the following command output something in your environment? or empty?
$ echo $NODE_PATH
The latest versions of node and npm no longer add the global node_modules directory to $NODE_PATH
. See this.
Could this package be updated to use the eslint
binary installed by npm install eslint -g
directly? It looks like this is how the sublime-jshint package handles this.
Running npm link eslint
in the Sublime ESLint package directory appears to provide a temporary workaround.
@polygonplanet Apologies, I'd forgotten to reply. My NODE_PATH env variable is not set.
$ echo $NODE_PATH
$
@jkirkwood thanks for your hint!
@programmist OK, As in nodejs document, if the following pass is valid, try setting "node_modules_path": "$HOME/.node_modules"
etc.
Or, try to set "node_modules_path": ""
, and enter following command in terminal:
cd YOUR_SUBLIME_ESLINT_PACKAGES_FOLDER
# example: cd /Users/userx/Library/Application Support/Sublime Text 3/Packages/ESLint
npm link eslint
I'm good if you want to close this. Or let me know and I'll close it. Thanks for your help.
I just tried to install ESLint, and got the same error. Upon running npm link eslint
in my ESLint package folder, I now get:
/usr/local/lib/node_modules/eslint/lib/util/module-resolver.js:74
throw new Error(Cannot find module '${name}'\
);
^
Error: Cannot find module 'babel-eslint' at ModuleResolver.resolve (/usr/local/lib/node_modules/eslint/lib/util/module-resolver.js:74:19) at loadFromDisk (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:544:42) at Object.load (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:592:20) at Config.getLocalConfigHierarchy (/usr/local/lib/node_modules/eslint/lib/config.js:228:44) at Config.getConfigHierarchy (/usr/local/lib/node_modules/eslint/lib/config.js:182:43) at Config.getConfigVector (/usr/local/lib/node_modules/eslint/lib/config.js:287:21) at Config.getConfig (/usr/local/lib/node_modules/eslint/lib/config.js:330:29) at processText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:162:33) at processFile (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:245:18) at executeOnFile (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:585:25)
@mdaross-ha Did you install eslint npm install -g eslint
?
Yes, I did that before trying to install the plugin.
From: polygon planet notifications@github.com Reply-To: polygonplanet/sublime-text-eslint reply@reply.github.com Date: Friday, July 14, 2017 at 7:16 PM To: polygonplanet/sublime-text-eslint sublime-text-eslint@noreply.github.com Cc: Michael Daross mdaross@homeaway.com, Mention mention@noreply.github.com Subject: Re: [polygonplanet/sublime-text-eslint] Error: Cannot find module 'eslint' (#9)
@mdaross-hahttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mdaross-2Dha&d=DwMCaQ&c=tmh68fGhvYqZefO02qmwIQ&r=P8zvuXdNS0F_6ytNCVDDU3o1iKS2Y9qd9Z13W-m5hx8&m=TkhWc_VUcizm1yEhGBAgGYsUlRIJiut0IXW6l6QeDLA&s=WLaC2Zz7PnwQLSmU2PAqnOYaV1FOH5ODuqjjkHnFMIU&e= Did you install eslint npm install -g eslint ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_polygonplanet_sublime-2Dtext-2Deslint_issues_9-23issuecomment-2D315495313&d=DwMCaQ&c=tmh68fGhvYqZefO02qmwIQ&r=P8zvuXdNS0F_6ytNCVDDU3o1iKS2Y9qd9Z13W-m5hx8&m=TkhWc_VUcizm1yEhGBAgGYsUlRIJiut0IXW6l6QeDLA&s=oOpNOLoVg_BkcbIZOobR_VCQ07m4aLKoU3zp_gf8QgA&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AbyA2ggLqUvCWa2qccw00KTmzEMqJzyrks5sOATDgaJpZM4MH-2Dpb&d=DwMCaQ&c=tmh68fGhvYqZefO02qmwIQ&r=P8zvuXdNS0F_6ytNCVDDU3o1iKS2Y9qd9Z13W-m5hx8&m=TkhWc_VUcizm1yEhGBAgGYsUlRIJiut0IXW6l6QeDLA&s=b9gAuzl941uegY82-ZUL3bV9STLZk7p1VhCuSuRHD-4&e=.
same problem
I got same problem
manually:
// C:\Users\<USERNAME>\AppData\Roaming\Sublime Text 3\Packages\User\ESLint.sublime-settings
{
"node_modules_path": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\npm\\node_modules",
}
If the problem is not solved yet, we want to know more detail. We close this issue once.
If you're still facing issue after adding node_modules_path
. Restart Sublime Text!
installing eslint
and babel-eslint
locally ( using --save option ) worked for me.
Running
npm link eslint
in the Sublime ESLint package directory appears to provide a temporary workaround.
Thanks ! :)
I'm getting the following error when I try to run ESLint within Sublime 3.
Steps to Reproduce:
npm install -g eslint
"node_path": "/usr/local/bin"
"node_modules_path": "/usr/local/lib/node_modules"
System:
This may be a regression of #2, but unfortunately the discussion in that issue did not help me.
Thank you.