Trouble building react-webapp with ESLint; ESLint couldn't find the config "developit" to extend from - node.js

My react app works as normal using npm start, but when I try npm run build I got trouble.
Oops! Something went wrong! :(
ESLint: 6.8.0.
ESLint couldn't find the config "developit" to extend from. Please check that the name of the config is correct.
The config "developit" was referenced from the config file in "/home/user/beregning-innsikt/beregning-innsikt-webapp/src/main/webapp/node_modules/#babel/preset-modules/package.json".
If you still have problems, please stop by https://gitter.im/eslint/eslint to chat with the team.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! beregning-innsikt-webapp#2.0.0 lint: `eslint 'src/**/*{.ts,.tsx}'`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the beregning-innsikt-webapp#2.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2020-08-11T08_20_44_975Z-debug.log
ERROR: "lint" exited with 2.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! beregning-innsikt-webapp#2.0.0 prebuild: `npm-run-all clean lint && aurora-mi git`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the beregning-innsikt-webapp#2.0.0 prebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2020-08-11T08_20_45_002Z-debug.log
The Babel config file contains this:
"eslintConfig": {
"extends": "developit",
"rules": {
"no-console": 0,
"new-cap": 0
}
},
I have tried node v 13.7.0 and 14.1.0.
Does anybody know how to solve this problem?

Seems like it is linting node_modules too
To fix this you can create file .eslintignore in your root directory and add node_modules/ folder to your eslintignore file

Related

Npm React js start error - ELIFECYCLE ERRNO1

The system cannot find the path specified.
npm ERR!
code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-able-pro#1.0.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-able-pro#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
ive got some error when i npm start, it always like this when i restart my pc,
ive already use
npm cache clear --force
deleting my modules app and package-lock.jason
npm install
and its doesnt work at all, can you guys help me ?
The library that you are trying to run is "react-able-pro". Through a search on www.npmjs.com for this library, I was not able to find it. However I was able to find react-table-pro.
It looks like a typo. try to fix your package.json file dependencies/devDependencies and then try to reinstall

NPM run dev error after requiring Tailwind CSS

I'm just dipping my toes into using Laravel for the first time, and I've had many issues so far. I've figured them out myself so far, but this one is driving me crazy!
After adding the line require('tailwindcss') in my webpack.mix.js file, I keep getting the following error when I run.
npm run dev
✖ Mix
Compiled with some errors in 452.52ms
ERROR in ./resources/css/app.css
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
TypeError: Cannot read property 'config' of undefined
at getTailwindConfig (/home/timothy/blog/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:81:62)
at /home/timothy/blog/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:124:92
at /home/timothy/blog/node_modules/tailwindcss/lib/processTailwindFeatures.js:41:11
at plugins (/home/timothy/blog/node_modules/tailwindcss/lib/index.js:20:104)
at LazyResult.runOnRoot (/home/timothy/blog/node_modules/postcss/lib/lazy-result.js:339:16)
at LazyResult.runAsync (/home/timothy/blog/node_modules/postcss/lib/lazy-result.js:393:26)
at LazyResult.async (/home/timothy/blog/node_modules/postcss/lib/lazy-result.js:221:30)
at LazyResult.then (/home/timothy/blog/node_modules/postcss/lib/lazy-result.js:206:17)
at processResult (/home/timothy/blog/node_modules/webpack/lib/NormalModule.js:751:19)
at /home/timothy/blog/node_modules/webpack/lib/NormalModule.js:853:5
at /home/timothy/blog/node_modules/loader-runner/lib/LoaderRunner.js:399:11
at /home/timothy/blog/node_modules/loader-runner/lib/LoaderRunner.js:251:18
at context.callback (/home/timothy/blog/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
at Object.loader (/home/timothy/blog/node_modules/postcss-loader/dist/index.js:142:7)
1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
webpack compiled with 2 errors
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: `mix`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/timothy/.npm/_logs/2022-01-18T04_24_37_451Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/timothy/.npm/_logs/2022-01-18T04_24_37_460Z-debug.log
I've looked into my version of Node.js and PostCSS being an issue, as my version of node.js has been an issue that caused other problems I've had so far, but those two seem fine. If it matters, this is a Laravel project created with Composer on Ubuntu 20.04 with Laravel installer 4.2.9.
Just run this comman. Tailwind config file is missing.
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init

nightwatch Error "Error: ENOENT: no such file or directory .../examples/pages"

I am starting to use nightwatch (followed this tutorial -
https://blog.risingstack.com/end-to-end-testing-with-nightwatch-js-node-js-at-scale/)
I created a folder in "/Users/luisfranqueira/fyde/experiments"
And inside I have the structure:
/bin /reports /tests nightwatch.json
when running the tests follow all instructions in the tutorial - I run the command "npm run test-e2e"
I get the following error:
> # test-e2e /Users/luisfranqueira
> nightwatch
There was an error while starting the test runner:
Error: Cannot read source folder: /Users/luisfranqueira/examples/tests
at /Users/luisfranqueira/node_modules/nightwatch/lib/runner/run.js:203:21
at /Users/luisfranqueira/node_modules/nightwatch/lib/runner/walk.js:97:18
at FSReqWrap.oncomplete (fs.js:152:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # test-e2e: `nightwatch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # test-e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/luisfranqueira/.npm/_logs/2017-12-05T12_23_49_345Z-debug.log
I know that this is probably a miss configured path, however, I don't know where to change it....

I am getting different results running a script with npm than calling the command directly - Node

I am setting up my environment to lint ES6. I installed eslint and can see it in my node_modules. In my node_modules/bin directory, I have the command eslint.
I can run the command and point it at the directory and I get no errors:
./node_modules/.bin/eslint src/main/webapp/js/lcrf
I can see all of the linting errors that I need to fix.
I have also added the command into my package.json:
"scripts": {
"lint": "eslint src/main/webapp/js/lcrf"
},
Now I try to run the command with npm run lint. It lints my files and I get the same number of linting errors, but then node errors out. Here is my stacktrace:
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "lint"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! lcrf#0.0.0 lint: `eslint src/main/webapp/js/lcrf`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lcrf#0.0.0 lint script 'eslint src/main/webapp/js/lcrf'.
npm ERR! This is most likely a problem with the lcrf package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! eslint src/main/webapp/js/lcrf
npm ERR! You can get their info via:
npm ERR! npm owner ls lcrf
npm ERR! There is likely additional logging output above.
What would cause this to happen? What is the difference in the 2 ways that I am running the command?
npm is freaking out over the non-zero return code from eslint. If you want lint errors to be an indication of "whoa, that's not supposed to happen, red alert, something is really wrong if this got published" then that's what you've got.
If you don't use the exit code (say, to stop subsequent build steps) and you just want the output to be just the eslint output and no subsequent npm freak out, use this in your package.json:
"lint": "eslint src/main/webapp/js/lcrf || exit 0"
Note this in "Best Practices" section of the npm scripts docs:
Don't exit with a non-zero error code unless you really mean it. Except for uninstall scripts, this will cause the npm action to fail, and potentially be rolled back. If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully.

npm run cmd fails while cmd on command line works

In my HTTP Status Check project:
If I run node_modules/.bin/jshint . I get:
$ node_modules/.bin/jshint .
test/inAdapters_fileAdapter.js: line 73, col 31, Missing semicolon.
1 error
It executes correctly and produces the expected output: 1 error.
But if I add that command to package.json and try and run it through npm run then it works and produces the expected output but also follows that with a bunch of errors:
$ npm run jshint
> http-status-check#0.0.5 jshint /home/guy/source/http-status-check
> jshint .
test/inAdapters_fileAdapter.js: line 73, col 31, Missing semicolon.
1 error
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/home/guy/local/bin/npm" "run" "jshint"
npm ERR! node v0.10.31
npm ERR! npm v2.0.0
npm ERR! code ELIFECYCLE
npm ERR! http-status-check#0.0.5 jshint: `jshint .`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the http-status-check#0.0.5 jshint script.
npm ERR! This is most likely a problem with the http-status-check package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! jshint .
npm ERR! You can get their info via:
npm ERR! npm owner ls http-status-check
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/guy/source/http-status-check/npm-debug.log
This is how it's defined in package.json:
"scripts": {
"jshint": "node_modules/.bin/jshint .",
},
What have I done wrong?
Don't exit with a non-zero error code unless you really mean it. Except for uninstall scripts, this will cause the npm action to fail, and potentially be rolled back. If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully.
From https://www.npmjs.org/doc/misc/npm-scripts.html
Use:
node_modules/.bin/jshint .; true
Or write a wrapper that calls jshint and then ignores the exit code and exits successfully with a exit code of zero.

Resources