Eslint works with setup below but causes few errors I do not understand.
As you can see when I run meteor npm run lint npm throws error below. It completes the lint and then says it failed to complete?
--UPDATE-- I fixed this issue by adding exit 0 attribute to gracefully exit the eslit process. If you run into the same issue look at my package.json line "lint": "eslint .;exit 0", to fix this. Leaving this for reference
Problem is that I am not sure how to make eslint ignore imports from the meteor. I have tried with eslint-plugin-meteor and turning on import resolver meteor, but that does not seem to work.
--UPDATE-- I silenced errors in .eslintrc file in below question, until issue described below is fixed [https://github.com/clayne11/eslint-import-resolver-meteor/issues/11] Leaving this for reference
/Users/kimmo/Documents/carecity/server/main.js
1:1 error 'meteor' should be listed in the project's dependencies. Run 'npm i -S meteor' to add it import/no-extraneous-dependencies
1:24 error Unable to resolve path to module 'meteor/meteor' import/no-unresolved
✖ 2 problems (2 errors, 0 warnings)
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/kimmo/.meteor/packages/meteor-tool/.1.4.1_1.1ugzqvs++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node" "/Users/kimmo/.meteor/packages/meteor-tool/.1.4.1_1.1ugzqvs++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm" "run" "lint"
npm ERR! node v4.5.0
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! carecity# lint: eslint .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the carecity# 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 carecity 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 carecity
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls carecity
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/kimmo/Documents/carecity/npm-debug.log
My package.json file below >
{
"name": "carecity",
"private": true,
"scripts": {
"start": "meteor run",
"lint": "eslint .;exit 0",
"pretest": "npm run lint --silent"
},
"eslintConfig": {
"parser": "babel-eslint",
"parserOptions": {
"allowImportExportEverywhere": true
},
"plugins": [
"meteor"
],
"extends": [
"airbnb",
"plugin:meteor/recommended"
],
"settings": {
"import/resolver": "meteor"
},
"rules": {}
},
"dependencies": {
"algoliasearch": "^3.18.1",
"instantsearch.js": "^1.8.5",
"material-icons": "^0.1.0",
"material-ui": "^0.15.4",
"meteor-node-stubs": "~0.2.0",
"react": "^15.3.1",
"react-addons-pure-render-mixin": "^15.3.1",
"react-dom": "^15.3.1",
"react-router": "^2.8.0",
"react-tap-event-plugin": "^1.0.0",
"roboto-fontface": "^0.6.0"
},
"devDependencies": {
"babel-eslint": "^6.1.2",
"eslint": "^3.5.0",
"eslint-config-airbnb": "^11.1.0",
"eslint-import-resolver-meteor": "^0.3.3",
"eslint-plugin-import": "^1.14.0",
"eslint-plugin-jsx-a11y": "^2.2.1",
"eslint-plugin-meteor": "^4.0.0",
"eslint-plugin-react": "^6.2.0",
"faker": "^3.1.0",
"getstorybook": "^1.4.5"
}
}
My .eslintrc file >
// Temporary fix for errors caused by airbnb rules https://github.com/airbnb/javascript/issues/978
// "import/no-extraneous-dependencies": "off" and "settings": { "import/core-modules": [ "meteor/meteor" ] }
// added temperatery to to silence meteor import warning see issue > https://github.com/clayne11/eslint-import-resolver-meteor/issues/11
{
"extends": "airbnb",
"rules": {
"react/require-extension": "off",
"import/no-extraneous-dependencies": "off"
},
"settings": {
"import/core-modules": [ "meteor/meteor" ]
}
}
See my updated on the above question.
Error one can be fixed simply by adding "lint": "eslint .;exit 0" on the package.json file
Error 2 is currently been worked on in Github issue https://github.com/clayne11/eslint-import-resolver-meteor/issues/11 To temporarily silence the issues you can use .eslintrc in my example above.
Related
When trying to install material ui get a load of dependency resolution errors. Not quite sure what the cause is. I previously tried to install V4 and got an error, that I thought I would resolve by using V5 because this version of React isn't compatible with V4 but I have no idea about the rest of the conflicts.
npm i #mui/material #emotion/react #emotion/styled
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #material-ui/core#4.12.4
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! peer react#"^18.0.0" from #testing-library/react#13.3.0
npm ERR! node_modules/#testing-library/react
npm ERR! dev #testing-library/react#"^13.3.0" from the root project
npm ERR! peer react#">=16" from phosphor-react#1.4.1
npm ERR! node_modules/phosphor-react
npm ERR! dev phosphor-react#"^1.4.1" from the root project
npm ERR! 18 more (react-dom, react-dropzone, react-media, react-popper, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.12.4" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.12.4" from the root project
npm ERR!
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
package.json:
{
"name": "wordscramble",
"version": "0.1.0",
"private": true,
"dependencies": {
"#material-ui/core": "^4.12.4",
"#testing-library/jest-dom": "^5.16.4",
"#testing-library/user-event": "^13.5.0",
"bootstrap": "^5.2.0",
"jquery": "^3.6.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.2",
"react-media": "^1.10.0",
"react-router": "^6.3.0",
"react-scripts": "5.0.1",
"react-tinder-card": "^1.4.5",
"reactstrap": "^9.1.2",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"#testing-library/react": "^13.3.0",
"fetch-mock": "^9.11.0",
"msw": "^0.44.2",
"phosphor-react": "^1.4.1",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-test-renderer": "^18.2.0"
}
}
Any help in identifying any potential conflicts would be greatly appreciated,
thanks!
1- uninstall #material-ui :
npm uninstall #material-ui/core
2 - install Mui v5 :
npm install #mui/material #mui/styled-engine-sc styled-components
Works with --legacy-peer-deps:
npm i #mui/material #emotion/react #emotion/styled --legacy-peer-deps
For more details see react v17 section on this answer https://stackoverflow.com/a/66620869/1515819
npm install #mui/x-data-grid
throws an error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: highradius#0.1.0
npm ERR! Found: react#18.0.0
npm ERR! node_modules/react
npm ERR! react#"^18.0.0" from the root project
npm ERR! peer react#"^17.0.0 || ^18.0.0" from #mui/material#5.6.0
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"^5.6.0" from the root project
npm ERR! peer #mui/material#"^5.2.8" from #mui/x-data-grid#5.8.0
npm ERR! node_modules/#mui/x-data-grid
npm ERR! #mui/x-data-grid#"*" from the root project
npm ERR! 4 more (#emotion/react, #emotion/styled, react-dom, #mui/system)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.2" from #mui/x-data-grid#5.8.0
npm ERR! node_modules/#mui/x-data-grid
npm ERR! #mui/x-data-grid#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\01kar\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\01kar\AppData\Local\npm-cache\_logs\2022-04-06T12_50_46_543Z-debug-0.log
What I think is that there is some version mismatch in the dependencies.
New to react so can't understand the dependencies. Please give a step by step process to resolve this error.
{
"name": "highradius",
"version": "0.1.0",
"private": true,
"dependencies": {
"#emotion/react": "^11.9.0",
"#emotion/styled": "^11.8.1",
"#mui/base": "^5.0.0-alpha.75",
"#mui/material": "^5.6.0",
"#testing-library/jest-dom": "^5.16.3",
"#testing-library/react": "^12.1.4",
"#testing-library/user-event": "^13.5.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-scripts": "5.0.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
This is the package.json file.
I tried installing npm install #mui/material #emotion/react #emotion/styled and it was installed successfully now I am trying to install data grid but its showing me this error.
npm i #mui/x-data-grid --legacy-peer-deps
Installing using this solved the issue for me.
Based on #mui/x-data-grid's documentation, it looks like this snippet of code should fix this issue
"peerDependencies": {
"#mui/material": "^5.0.0",
"react": "^17.0.0"
},
add --legacy-peer-deps at the end of your npm command like below 👇
npm i #mui/x-data-grid --legacy-peer-deps
try npm install #mui/x-data-grid --legacy-peer-deps and it will work fine.
I got a task to do which is to create some forms with tailwindcss but When I try to launch : npm run build, it does't work. Could you help me?
npm ERR! code ELIFECYCLE
npm ERR! errno 9
npm ERR! widgets#1.0.0 dev: `tailwind build css/tailwind.css -o build/css/tailwind.css`
npm ERR! Exit status 9
npm ERR!
npm ERR! Failed at the widgets#1.0.0 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! /Users/andresbolivar/.npm/_logs/2022-01-21T16_59_01_550Z-debug.log
this is my package.json
{
"name": "widgets",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"dev": "tailwind build style.css -o /css/tailwind.css"
},
"author": "",
"license": "ISC",
"devDependencies": {
"autoprefixer": "^10.4.2",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.15"
},
"dependencies": {},
"description": ""
}
You need to install Tailwind CLI in order to execute tailwind commands:
# Using NPM?
npm install -D tailwindcss
# Using yarn?
yarn add tailwindcss -D
Also, it helps to check the error log (as mentioned in the message printed to your terminal) to find out a full stack trace of the error.
I'm having an error whenever I try building my app with Electron.
I didn't have this issue until last week or so, It was working fine before, it suddenly stopped working.
I didn't understand the issue so I reinstalled my OS and everything on the computer, but it didn't change anything. I found some messages on the terminal telling me to install python, then VSCode with C++ for desktop applications, I did, then the error changed and I don't see any way to fix it any further.
This is my package.json, im running 'npm run build':
{
"name": "reactron",
"version": "0.1.0",
"private": true,
"dependencies": {
"#szhsin/react-menu": "^1.8.0",
"brace": "^0.11.1",
"electron-is-dev": "^1.1.0",
"fs-extra": "^10.0.0",
"gpu.js": "^2.11.4",
"gsap": "^3.4.0",
"howler": "^2.1.3",
"jsoneditor": "^9.5.6",
"jsoneditor-react": "^3.1.1",
"node-sass": "^4.14.1",
"react-draggable": "^4.4.3",
"react-json-editor-ajrm": "^2.5.13",
"react-xarrows": "^1.5.2",
"vanilla-picker": "^2.11.2"
},
"main": "public/electron.js",
"homepage": "./",
"scripts": {
"react-start": "react-scripts start",
"react-build": "react-scripts build",
"react-test": "react-scripts test --env=jsdom",
"react-eject": "react-scripts eject",
"electron-build": "electron-builder",
"build-electron": "mkdir build/src && robocopy electron build/electron /S & robocopy src/shared build/src/shared /S",
"release": "npm run react-build && electron-builder --publish=always",
"build": "npm run react-build && npm run electron-build",
"start": "concurrently \"cross-env BROWSER=none npm run react-start\" \"wait-on http://localhost:3000 && electron .\""
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"#reduxjs/toolkit": "^1.3.6",
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.5.0",
"#testing-library/user-event": "^7.2.1",
"concurrently": "^5.1.0",
"cross-env": "^7.0.2",
"electron": "^8.1.1",
"electron-builder": "^22.13.1",
"electron-packager": "^14.2.1",
"electron-react-devtools": "^0.5.3",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-indiana-drag-scroll": "^1.8.0",
"react-redux": "^7.2.0",
"react-scripts": "^3.4.3",
"redux": "^4.0.5",
"wait-on": "^4.0.1"
},
"build": {
"asar": false
}
}
And this is the output:
> reactron#0.1.0 electron-build C:\Users\Toqu\Documents\_works\reactron
> electron-builder
• electron-builder version=22.13.1 os=10.0.19043
• loaded configuration file=package.json ("build" field)
• loaded parent configuration preset=react-cra
• description is missed in the package.json appPackageFile=C:\Users\Toqu\Documents\_works\reactron\package.json
• author is missed in the package.json appPackageFile=C:\Users\Toqu\Documents\_works\reactron\package.json
• writing effective config file=dist\builder-effective-config.yaml
• rebuilding native dependencies dependencies=gl#4.9.2, node-sass#4.14.1 platform=win32 arch=x64
• install prebuilt binary name=gl version=4.9.2 platform=win32 arch=x64 napi=
• build native dependency from sources name=gl
version=4.9.2
platform=win32
arch=x64
napi=
reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
error=prebuild-install info begin Prebuild-install version
5.3.6
prebuild-install WARN install prebuilt binaries enforced with --force!
prebuild-install WARN install prebuilt binaries may be out of date!
prebuild-install info looking for cached prebuild # C:\Users\Toqu\AppData\Roaming\npm-cache\_prebuilds\370169-gl-v4.9.2-electron-v76-win32-x64.tar.gz
prebuild-install http request GET https://github.com/stackgl/headless-gl/releases/download/v4.9.2/gl-v4.9.2-electron-v76-win32-x64.tar.gz
prebuild-install http 404 https://github.com/stackgl/headless-gl/releases/download/v4.9.2/gl-v4.9.2-electron-v76-win32-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=8.5.5 runtime=electron arch=x64
libc= platform=win32)
⨯ cannot execute cause=exit status 1
out=
> gl#4.9.2 install C:\Users\Toqu\Documents\_works\reactron\node_modules\gl
> prebuild-install || node-gyp rebuild
C:\Users\Toqu\Documents\_works\reactron\node_modules\gl>if not defined npm_config_node_gyp (node
"C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Copying C:\Users\Toqu\Documents\_works\reactron\node_modules\gl/deps/windows/dll/x64/libEGL.dll to C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\libEGL.dll
1 file(s) copied.
Copying C:\Users\Toqu\Documents\_works\reactron\node_modules\gl/deps/windows/dll/x64/libGLESv2.dll to C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\libGLESv2.dll
1 file(s) copied.
Copying C:\Users\Toqu\Documents\_works\reactron\node_modules\gl/deps/windows/dll/x64/d3dcompiler_47.dll to C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\d3dcompiler_47.dll
1 file(s) copied.
bindings.cc
webgl.cc
procs.cc
win_delay_load_hook.cc
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8923,39): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\procs.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8931,42): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\procs.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8923,39): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\bindings.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8931,42): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\bindings.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8923,39): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\webgl.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8931,42): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\webgl.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\src\native\webgl.cc(466,37): warning C4312: 'reinterpret_cast': conversion from 'GLint' to 'GLvoid *' of greater size [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
Creating library C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\webgl.lib and object C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\webgl.exp
webgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> __cdecl v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore#ArrayBuffer#v8##QEAA?AV?$shared_ptr#VBackingStore#v8###std##XZ) referenced in function "public:
__cdecl Nan::TypedArrayContents<char>::TypedArrayContents<char>(class v8::Local<class v8::Value>)" (??0?$TypedArrayContents#D#Nan##QEAA#V?$Local#VValue#v8###v8###Z) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\webgl.node : fatal error LNK1120: 1 unresolved externals [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
errorOut=prebuild-install WARN install No prebuilt binaries found (target=8.5.5 runtime=electron arch=x64 libc= platform=win32)
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Toqu\Documents\_works\reactron\node_modules\gl
gyp ERR! node -v v14.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gl#4.9.2 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gl#4.9.2 install 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! C:\Users\Toqu\AppData\Roaming\npm-cache\_logs\2021-10-27T14_22_32_528Z-debug.log
command='C:\Program Files\nodejs\node.exe' 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' rebuild gl#4.9.2 node-sass#4.14.1
workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactron#0.1.0 electron-build: `electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactron#0.1.0 electron-build 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! C:\Users\Toqu\AppData\Roaming\npm-cache\_logs\2021-10-27T14_22_32_631Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactron#0.1.0 build: `npm run react-build && npm run electron-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactron#0.1.0 build 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! C:\Users\Toqu\AppData\Roaming\npm-cache\_logs\2021-10-27T14_22_32_666Z-debug.log
Does anyone know how to solve this?
This is the ERROR. I use visual studio code with gitBash.
$ npm i mini-css-extract-plugin
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: lesson-54-intro-webpack#1.0.0
npm ERR! Found: webpack#4.46.0
npm ERR! node_modules/webpack
npm ERR! dev webpack#"^4.39.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack#"^5.0.0" from mini-css-extract-plugin#2.2.0
npm ERR! node_modules/mini-css-extract-plugin
npm ERR! mini-css-extract-plugin#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Smith\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Smith\AppData\Local\npm-cache\_logs\2021-08-19T13_12_04_740Z-debug.log
This is my package JSON file. What could be wrong here?
How to match versions?
{
"name": "lesson-54-intro-webpack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server",
"build": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"#babel/core": "^7.5.5",
"#babel/preset-env": "^7.5.5",
"autoprefixer": "^9.6.1",
"babel-core": "^6.26.3",
"babel-loader": "^8.0.6",
"babel-polyfill": "^6.26.0",
"css-loader": "^3.1.0",
"file-loader": "^4.1.0",
"html-webpack-plugin": "^3.2.0",
"postcss-loader": "^3.0.0",
"precss": "^4.0.0",
"style-loader": "^0.23.1",
"webpack": "^4.39.1",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2"
},
"dependencies": {
"axios": "^0.19.0"
}
}
See the edit below.
As the error says the webpack version not matched try either:
upgrade lesson-54-intro-webpack package
downgrade mini-css-extract-plugin
Edit: based on your package.json content
You need to upgrade your webpack version to version 5