question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tip: Things to check if you get an npm run lint error or build error

See original GitHub issue

I am opening this issue as I also caught up in the npm run lint error issues. After a few hours research on github issues and googling, I found the current checklist to resolve this issue. (Note: this applies to both react-slingshot and react-redux course git repo)

  • First Make Sure .eslintrc is in your project root folder. The current ESW have some weird behavior in terms of reading .eslintrc. Even your .eslintrc is not in your root folder, for example, I accidentally put mine in the /tools folder, some of the setting will still be activated like parserOptions but none of the rules are valid.
  • Putting the .eslintrc in the wrong folder would lead to Parsing error: The keyword 'import' is reserved

And it is not related to the setting of your .eslintrc but whether it is in your root folder or not. If you didn’t put

"sourceType": "module", "ecmaFeatures": { "jsx": true, "modules": true }

  • Missing modules setting would lead to Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
  • Second change the npm run lint script to "esw webpack.config.* src tools; exit 0" and change the npm run lint:watch script to "esw webpack.config.* src tools --watch; exit 0" If ESW found any error or warning in your project like console statement or missing semi, the lint thread will be exit with Exit status 1. This will lead to an ELIFECYCLE error. This is actually not an error but a warning of ESW to indicate that it will print out all the warning and error. Adding exit 0 will not break the eslint checking but allow npm script to ignore the status 1 and allow ESW to print all all the warning and error.
  • Third check eslint/esw global install version and the local version to match. This is not an issue I encounter but, make sure the global install is not outdate or out-sync with local project will help you resolve the ‘esw’ keyword. And this means we could use esw to replace the /node_modules/.bin/esw.

These are all the issues I found regarding debugging npm run lint issues. I hope this helps a lot current unresolved opened issues. Including some closed issues with is not correctly resolved.

This include: https://github.com/coryhouse/react-slingshot/issues/133 https://github.com/coryhouse/react-slingshot/issues/84 https://github.com/coryhouse/react-slingshot/issues/150

Note: I did not reproduce the issue above, some my solution could be not working with the above issues but I think this is a pretty solid solution to the current version of eslint/esw/npm script.

Credit to: modules solution exit 0 solution

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:9
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
piotrtrojanowskicommented, Jul 30, 2018

This lint thing does not work for me on Windows… Even if I applied all the suggestions. I just ignore it for the time being… In general this is why it is difficult for me to start with all these tools: versioning nightmare + completely unreadable error messages… We are still in medieval when it comes to building software! 😃

esw webpack.config.* src buildScripts --color; exit 0 npm ERR! code ELIFECYCLE npm ERR! errno 1

1reaction
coryhousecommented, Aug 19, 2017

Hi @romarioraffington - Thanks! I corrected a minor typo by editing your comment. Let’s omit the first bullet since that code is already included in the project. but otherwise looks great. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM — How to Run ESLint --fix From npm Script - Future Studio
A typical command is to run the test suite for the project. ... You can then create a lint:fix script reusing the lint...
Read more >
How to prevent npm run lint from fixing errors automatically?
I have a GitHub action workflow checking the code style and using npm run lint is wrong because the workflow fixes the code...
Read more >
Common errors | npm Docs
Some strange issues can be resolved by simply running npm cache clean and trying again. · If you are having trouble with npm...
Read more >
npm Scripts: Tips Everyone Should Know - Corgibytes
js && rimraf dist", "build": "webpack --bail --progress --profile --display-error-details",. To fix this, we'll have to update the task variable ...
Read more >
Tasks in Visual Studio Code
Executing the task produces one error, shown in the Problems view: ... A tasks.json that configures the npm: run lint task and adds...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found