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

Unable to setup developer environment #7239

Closed
JeremyTCD opened this issue Sep 25, 2016 · 9 comments
Closed

Unable to setup developer environment #7239

JeremyTCD opened this issue Sep 25, 2016 · 9 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly build This change relates to ESLint's build process

Comments

@JeremyTCD
Copy link

JeremyTCD commented Sep 25, 2016

Tell us about your environment

  • ESLint Version: Latest
  • Node Version: 6.5.0
  • npm Version: 3.10.8

What did you do? Please include the actual source code causing the issue.

I forked eslint and followed the developer guide up till step 5. I then ran npm test.

What did you expect to happen?
Expected tests to pass successfully.

What actually happened? Please include the actual, raw output from ESLint.
When I ran npm test i got the following error:

Oops! Something went wrong!
ESLint couldn't find the plugin "eslint-plugin-node". This can happen for a couple different reasons:
If ESLint is installed globally, then make sure eslint-plugin-node is also installed globally.
A globally-installed ESLint cannot find a locally-installed plugin.
If ESLint is installed locally, then it's likely that the plugin isn't installed correctly.
Try reinstalling by running the following:
npm i eslint-plugin-node@latest --save-dev
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team..

eslint-plugin-node was in my node_modules folder. However it had an unfulfilled peer dependency. When I ran npm list i got this error:

npm ERR! peer dep missing: eslint@>=2.0.0, required by eslint-plugin-node@2.1.0

npm install eslint --save causes this error though:

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Jeremy\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "eslint" "--save"
npm ERR! node v6.5.0
npm ERR! npm v3.10.7
npm ERR! code ENOSELF
npm ERR! Refusing to install eslint as a dependency of itself
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Jeremy\Desktop\LibrariesAndTools\eslint\eslint\npm-debug.log

Any assistance would be greatly appreciated. Thank you.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Sep 25, 2016
@ghost
Copy link

ghost commented Sep 25, 2016

The issue is reproducible in Travis for Node 5.x and above.

@not-an-aardvark
Copy link
Member

not-an-aardvark commented Sep 25, 2016

I can reproduce this. It might be caused by the release of eslint-plugin-node@2.1.0.

cc @mysticatea

edit: When I run require('eslint-plugin-node') in the REPL, I get this error:

Error: Cannot find module 'eslint/lib/ast-utils'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (path/to/eslint/node_modules/eslint-plugin-node/lib/rules/exports-style.js:12:16)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

I think the issue is happening because eslint-plugin-node has eslint as a peerDependency, but eslint can't be installed into node_modules as a dependency of itself.

@not-an-aardvark
Copy link
Member

As a temporary workaround, you can fix the problem by using npm install eslint --force.

@kaicataldo kaicataldo added bug ESLint is working incorrectly build This change relates to ESLint's build process accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Sep 25, 2016
@kaicataldo
Copy link
Member

kaicataldo commented Sep 25, 2016

Have confirmed this locally. Locking eslint-plugin-node to v2.0.0 fixes this, which makes me think it's not the eslint peerDep causing the issue (since that change was present in v2.0.0 as well).

@mysticatea Any ideas why this might be happening?

@not-an-aardvark
Copy link
Member

@kaicataldo The issue is this line, which was just added in the latest release. It's trying to require() a file within eslint, and throwing because it's not there.

@platinumazure
Copy link
Member

platinumazure commented Sep 25, 2016

Wonder if we should consider creating a sub-package with some of the ESLint utils? That way eslint-plugin-node could just consume that (and I know of a few plugins which have wanted to use ast-utils or which have re-implemented their own ast-utils file).

Slightly outside the scope of this issue, though.

@mysticatea
Copy link
Member

I'm sorry, I will publish eslint-plugin-node@2.1.1 to resolve this soon.

@mysticatea
Copy link
Member

I have done.
I'm restarting Travis jobs.

@mysticatea
Copy link
Member

Closing as PRs seem good now.

I'm sorry, I had not realized this problem since I have the symlink of eslint in the node_modules of my local eslint repository.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly build This change relates to ESLint's build process
Projects
None yet
Development

No branches or pull requests

6 participants