Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Error running TSLint Error: Cannot read property 'findConfigurationPath' of undefined #206

Closed
eyaleizenberg opened this issue Oct 16, 2017 · 6 comments
Labels

Comments

@eyaleizenberg
Copy link

Trying to use the global tslint installation...

@smhxx
Copy link
Contributor

smhxx commented Oct 16, 2017

Appears to be due to a missing if-statement wrapping worker.js:146-148. It's not finding tslint in your global node_modules folder, but then it just assumes it found it rather than actually checking and falling back to the packaged version if necessary. That's my code, so I'll go ahead and fix it and put in a PR.

As for why it's not finding tslint, that's another question altogether. Can you do npm list -g tslint and see if it shows up? It is possible this is some sort of bug as well, but it's hard to tell without more information.

@smhxx
Copy link
Contributor

smhxx commented Oct 16, 2017

That should prevent the error from being thrown, but there's still the issue of why it's not finding tslint to begin with. You're sure you have it installed globally, as in "npm install -g tslint"? (Just trying to eliminate the possibilities starting with the simplest.) If you're able to run tslint from the command line, and it's still not finding it, that does seem a bit unusual.

@eyaleizenberg
Copy link
Author

@smhxx
➜ npm list -g tslint
/usr/local/lib
└── tslint@5.7.0

I am using nvm, I have a feeling that's related. The output shown above is for the system node.

@smhxx
Copy link
Contributor

smhxx commented Oct 16, 2017

Hmm, it might be related to nvm, I'm not sure if it changes any of npm's default settings. What does npm get prefix output? If it isn't /usr/local/lib, you might try specifying that as the global install path in your linter-tslint settings. If that is your npm prefix, then that makes me lean more towards it potentially being a bug.

@eyaleizenberg
Copy link
Author

Yup, specifying it to /usr/local/lib worked. Thank you!

@smhxx
Copy link
Contributor

smhxx commented Oct 16, 2017

Glad to hear it. 👍 I imagine you're probably right that nvm messes with your prefix and that's why the auto-detection fails. Oh, well. I think it's better to specify the path manually, anyway, so that's a valid workaround for anyone who runs into the same problem.

@Xapphire13 Xapphire13 added the bug label Oct 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants