-
Notifications
You must be signed in to change notification settings - Fork 337
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
Failed to load eslint library. Please install eslint in your workspace folder using 'npm install eslint' or globally using 'npm install -g eslint' and then pres #28
Comments
Hmm. this works for me with a locally installed eslint and 0.10.8. See screen shot @Ciget do you have a NODE_PATH environment variable set. I fixed a bug lately which cause the eslint load fail in case a NODE_PATH environment variable is present. |
@egamma are you using nvm? I'm experiencing this issue as well on my machines that have nvm installed. |
Sorry, looks like the original issue author was @Ciget |
@dbaeumer, nop, even after remove this variable from env settings and restart - still have this issue. |
As per my comment on issue #24, removing all globally installed NPM packages and reinstalling them fixed my issue. I'm pretty sure this is related to the latest NPM version using a different folder structure for dependencies, which I recently upgraded to. |
@ShimShamSam Are you on windows? I just tried removing all of my global modules per your solution and it didn't work. Very well could be because I'm on windows though and have my global modules stored in a non standard location. |
I played a little with this and here are my finds:
The eslint plugin uses 'npm config get prefix' to find the location of the globally installed modules. @collinforrester does this point to your global store ? |
Yes it does. I just tried to recreate the issue that I was having and its no longer occurring on this machine. So a combination of ShimShamSam's solution, reboot, vscode, and eslint update.. something seems to have fixed it. I realize that doesn't help much as far as specifics, but its what worked for me. |
I have a different case but with the same error. By the way I tested my project that is using My case is when opening a project that does not have |
The issue I had when installing ESLint in npm prefix is that the prefix was configured as an environment variable in |
@GeorgeSapkin thanks for the insight. Didn't even know that this is possible. |
I have the same issue and unfortunately it didn't get resolved via aforementioned solutions. I'm using NVM and ESlint is installed globally. Here are the details:
I've tried to use it locally too, but to no avail. I'm out of options. |
Actually, I don't understand why this is happening. I created #92 to add tracing options to better understand to which paths the module loading resolves and what exception occurred during module resolving. |
@nvma quick question: how does the directory look like below >/home/nvma/.nvm/versions/node/v6.2.1 Can you let me know where exactly the eslint node module resides on disk in your setup. |
@nvma and can you provide me with the output of npm root -g |
I am also running into the same issue.
|
@draptik thanks. Could you also run 'npm config get prefix'. I have the felling global modules are resolved against the wrond directory when using nvm |
@dbaeumer same problem here:
Installing it locally on the root folder of the project works for me but for me its not really a nice way. |
@Nighthawk22 this actually all looks ok. Can you do one thing for me: in /Users/maxzollneritsch/.nvm/versions/node/v4.4.3/lib/node_modules is there an eslint folder ? |
@dbaeumer Is listed in my comment, yes there is one |
I have the same issue, using
|
I'm having this issue with a single file, a html opened from a folder with no eslint configuration file nor I'm not using nvm and eslint is installed globally.
Also, here are the npm commands: madca@Freyr ~ $ npm root -g
C:\Users\madca\AppData\Roaming\npm\node_modules
madca@Freyr ~ $ npm config get prefix
C:\Users\madca\AppData\Roaming\npm |
I had an similar issue after uninstalling old node version and I was able to fix it by resetting nvm default to latest node version. Here's what happened. [Repro Steps]
Tada! |
Mine works when the plugin uses the global eslint install but when I install eslint locally it does not work. Using nvm |
This happens to me when I open a single javascript file that is part of a project with ESLint installed locally. For example, I use iTerm and run my watch script, whenever an error is reported I use CMD+Click to quickly open a file. Ideally, it should find the ESLint package in my project, but I was able to fix the problem by adding |
An update: |
I've run into this several times, besides the obvious failed installs or things like that. I noticed VSCode will not detect eslint if you current folder is not the project root. I mean, if your current workspace folder has no node_modules folder in there, it fails. I have to open the root folder for it to be detected. I'm not sure if there is a way to go around this or if it's a different issue. |
"child_process.exec" use '/bin/sh' as the default shell, but I use 'zsh', so 'npm config get prefix' maybe failed because of the wrong shell. |
After |
I re-implemented the eslint module resolution algorithm (see microsoft/vscode-languageserver-node#77, https://github.com/Microsoft/vscode-languageserver-node/blob/master/server/src/files.ts#L103). The new approach loads eslint from parent folders so you don't need to open the project root anymore. In addition it does NOT rely on I did various tests and things look good to me. However I kept the old resolution in and it can be enabled via |
I still run into this issue. I'm using yarn and my global eslint has path: |
The ESLint extension has currently no support for globally install eslint module via yarn. I opened: #187 |
@dbaeumer Should I comment this issue, if the problem has reoccurred? Or #92? I still have this problem:
Some versions: ESLint: 1.2.7 You've said, that ESLint does not use
ESLint has been installed In the last folder. Finally there are some weird lines in my
Thanks! |
@BairDev how did you install eslint globally. Using yarn? I just checked and the ESLint extension works correctly if:
|
@dbaeumer Sorry for kind of spamming this issue, but the problem has disappeared. I've just created a .eslintrc and then the stuff started to work. Thanks anyway. But in order to answer your question: I've installed eslint via |
From @Ciget on February 10, 2016 21:56
Hi folks,
I several time during using VS Code see error like this:
Of course i`ve tried to install it locally and globally as well, but no result - still the same error.
My OS - Windows 10. Version of VS Code - 0.10.8
Does somebody has the same issue and maybe you have thoughts how to fix it?
Thanks.
Copied from original issue: microsoft/vscode#2909
The text was updated successfully, but these errors were encountered: