Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.

Linting instructions result in error #509

Closed
athyuttamre opened this issue Jul 9, 2016 · 8 comments
Closed

Linting instructions result in error #509

athyuttamre opened this issue Jul 9, 2016 · 8 comments

Comments

@athyuttamre
Copy link

I just ran through the guide, creating a default app (meteor create 1.3-test) and ran through the section on setting up eslint. I'm running into this issue:

$ meteor npm run lint

> 1.3-test@ lint /Users/athyuttamre/Work/testbed/meteor/1.3-test
> eslint .


/Users/athyuttamre/Work/testbed/meteor/1.3-test/node_modules/strip-bom/index.js:2
module.exports = x => {
                    ^
SyntaxError: Unexpected token >
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/athyuttamre/Work/testbed/meteor/1.3-test/node_modules/eslint/lib/config/config-file.js:23:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

npm ERR! Darwin 15.5.0
npm ERR! argv "node" "/Users/athyuttamre/.meteor/packages/meteor-tool/.1.3.4_3.1hfml3w++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm" "run" "lint"
npm ERR! node v0.10.46
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! 1.3-test@ lint: `eslint .`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the 1.3-test@ lint script 'eslint .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the 1.3-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 1.3-test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 1.3-test
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/athyuttamre/Work/testbed/meteor/1.3-test/npm-debug.log

My guess is that the latest version of eslint has a Node dependency that Meteor doesn't yet have?

@athyuttamre
Copy link
Author

Running the command with just npm run lint with node v5 works fine.

@tmeasday
Copy link
Contributor

It looks like eslint doesn't like the ES2015 arrow syntax. Perhaps you didn't setup your eslint config properly?

@athyuttamre
Copy link
Author

Thanks for the reply Tom. My setup is simply the default one. My diagnosis is that since the default setup points to installing the latest eslint, and the latest eslint expects a Node version that has ES6 support, this is failing. The default Node on Meteor is 0.12, and the latest eslint is incompatible with that I believe.

Perhaps the guide ought to be updated to install a specific version of eslint?

@tmeasday
Copy link
Contributor

You might be right! I'd suggest using the version of eslint that we use in todos then https://github.com/meteor/todos/blob/master/package.json#L19

Can you let me know if this fixes it, and maybe we should update the guide to specify the version.

@fmilani
Copy link

fmilani commented Jul 13, 2016

Hi,

I am having the exact same problem as Athyuttam (and I followed the instructions on meteor guide).

I changed the version of eslint and its plugin to match the ones used in the todos app (as suggested by Tom) and now I'm getting a different error:

$ meteor npm run lint

> contatempo@ lint /home/fmilani/projects/contatempo
> eslint .

Property 'Symbol(Symbol.iterator)_9.2qk6vf1okzr7wrk9' of object [object Map] is not a function
TypeError: Property 'Symbol(Symbol.iterator)_9.2qk6vf1okzr7wrk9' of object [object Map] is not a function
    at EventEmitter.ProgramExit (/home/fmilani/projects/contatempo/node_modules/eslint-plugin-import/lib/rules/export.js:93:149)
    at EventEmitter.emit (events.js:117:20)
    at NodeEventGenerator.leaveNode (/home/fmilani/projects/contatempo/node_modules/eslint/lib/util/node-event-generator.js:49:22)
    at CodePathAnalyzer.leaveNode (/home/fmilani/projects/contatempo/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:627:23)
    at CommentEventGenerator.leaveNode (/home/fmilani/projects/contatempo/node_modules/eslint/lib/util/comment-event-generator.js:110:23)
    at Controller.traverser.traverse.leave (/home/fmilani/projects/contatempo/node_modules/eslint/lib/eslint.js:908:36)
    at Controller.__execute (/home/fmilani/projects/contatempo/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/home/fmilani/projects/contatempo/node_modules/estraverse/estraverse.js:491:28)
    at Controller.Traverser.controller.traverse (/home/fmilani/projects/contatempo/node_modules/eslint/lib/util/traverser.js:36:33)
    at EventEmitter.module.exports.api.verify (/home/fmilani/projects/contatempo/node_modules/eslint/lib/eslint.js:902:23)

npm ERR! Linux 3.19.0-64-generic
npm ERR! argv "node" "/home/fmilani/.meteor/packages/meteor-tool/.1.3.4_4.l8vdpz++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm" "run" "lint"
npm ERR! node v0.10.46
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! contatempo@ lint:`eslint .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the contatempo@ lint script 'eslint .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the contatempo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs contatempo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls contatempo
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/fmilani/projects/contatempo/npm-debug.log

I agree with Athyuttam about newer version of eslint expecting a node version that supports es6 syntax. But now it seems to be a problem with the eslint-plugin-import...

@tmeasday
Copy link
Contributor

tmeasday commented Jul 13, 2016

@fmilani see import-js/eslint-plugin-import#415 (the fix is update to eslint-plugin-import@1.10.3

@fmilani
Copy link

fmilani commented Jul 14, 2016

Thanks, Tom!

Updating to eslint-plugin-import@1.10.3 solved the issue!

@filipenevola
Copy link
Collaborator

I'm closing this issue because it's too old.

We are going to make many updates to the guide in the next weeks and it's better to focus on issues with recent activity. If you think this issue is still relevant please open a new one.

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

No branches or pull requests

4 participants