Browserslist error when starting dev server - npm

After clone repository and installing dependencies i run dev server of nuxt and got errors of browserslist in postcss dependency. I've searched by keyword "android all" in node_modules folder but got nothing.
I've tried to remove package-lock.json and node_modules folder and reinstall all dependencies but got the same result
When starting the dev server i've got following error log
Unknown browser query android all. Maybe you are using old Browserslist or made typo in query. 12:00:56
at unknownQuery (node_modules/postcss-preset-env/node_modules/browserslist/index.js:204:10)
at node_modules/postcss-preset-env/node_modules/browserslist/index.js:296:11
at Array.reduce (<anonymous>)
at resolve (node_modules/postcss-preset-env/node_modules/browserslist/index.js:237:18)
at browserslist (node_modules/postcss-preset-env/node_modules/browserslist/index.js:361:16)
at supportedBrowsers.some.supportedBrowser (node_modules/postcss-preset-env/index.js:438:105)
at Array.some (<anonymous>)
at stagedFeatures.filter.feature (node_modules/postcss-preset-env/index.js:438:80)
at Array.filter (<anonymous>)
at postcss$1.plugin.opts (node_modules/postcss-preset-env/index.js:438:44)
at creator (node_modules/postcss/lib/postcss.js:133:35)
at config.plugins.sortPlugins.map (node_modules/#nuxt/webpack/dist/webpack.js:4128:18)
at Array.map (<anonymous>)
at PostcssConfig.loadPlugins (node_modules/#nuxt/webpack/dist/webpack.js:4122:10)
at PostcssConfig.config (node_modules/#nuxt/webpack/dist/webpack.js:4158:14)
at StyleLoader.postcss (node_modules/#nuxt/webpack/dist/webpack.js:4215:39)
Thank you

Looks like there is an issue with browserlist.
Try to update your dependencies.
Browserlist 4.6.3 is the latest and this problem was fixed it it.

Related

TypeError: Cannot read property 'NormalModule' of undefined

I am working on a big project and I cannot run it anymore because of this error:
When I run npm run serve
ERROR TypeError: Cannot read property 'NormalModule' of undefined
TypeError: Cannot read property 'NormalModule' of undefined
at VueLoaderPlugin.apply (/Users/<user>/muso-ninjas/node_modules/vue-loader-v16/dist/pluginWebpack5.js:44:47)
at webpack (/Users/<user>/muso-ninjas/node_modules/#vue/cli-service/node_modules/webpack/lib/webpack.js:51:13)
at serve (/Users/<user>/muso-ninjas/node_modules/#vue/cli-service/lib/commands/serve.js:163:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Please help me because I am stuck and I would like to go with my project.
Try this first:
In your project root, run npm install. Maybe someone else on your project has changed/added a dependency, and pulling from your git repo got you the code that relies on this, but won't get you the dependency itself.
If that doesn't fix your issue, try this:
Remove the node_modules folder in your project root.
Update your Node.js version to the latest 16.x version.
2.1 Verify the update has worked by issuing node -v in the terminal.
Update your npm: Run npm i -g npm in the terminal.
3.1 Very the update has worked by issuing npm -v in the terminal.
Run npm install in your project's root folder.
If this doesn't fix your issue, you need to find help from someone else on your team.
As suggested in link from the first comment, I deleted node_modules, replaced the node-sass in package.json with "sass": "^1.26.5" and ran npm install but it didn't work.
Then I repeated the steps and removed package-lock.json as well.
This helped and the app was served properly
npm install webpack#4.39.3 --save

react native expo debugger-ui Error: EISDIR: illegal operation on a directory, read

I started a new app using expo
but when I try to open the debugger-ui
with cmd-d and click on debug remote js
I've got this ugly message:
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (node:fs:720:3)
at tryReadSync (node:fs:430:20)
at Object.readFileSync (node:fs:476:19)
at UnableToResolveError.buildCodeFrameMessage (/Users/me/my/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:304:17)
at new UnableToResolveError (/Users/me/my/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:290:35)
at ModuleResolver.resolveDependency (/Users/me/my/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:168:15)
at DependencyGraph.resolveDependency (/Users/me/my/node_modules/metro/src/node-haste/DependencyGraph.js:353:43)
at /Users/me/my/node_modules/metro/src/lib/transformHelpers.js:271:42
at Server.<anonymous> (/Users/me/my/node_modules/metro/src/Server.js:842:41)
at Generator.next (<anonymous>)
I tried googling but none of the solution works
Any idea to fix it?
It's a React-native issue; the error is linked to the metro dependencies inside node_modules.
The EISDIR error is likely to be a misreported error due to a bug in metro that has been fixed in metro 0.65.
Some methods of troubleshooting can be found here.
I uninstalled the Expo Go app from my phone, and then downloaded & installed it again, and it worked.
I ran into the same problem while I was changing some npm settings. I did a mistake with one npm config set command and this added a line referring to a non-existing directory to C:\Users\{User}\.npmrc. After I deleted that line manually from .npmrc, the problem was gone.

How to resolve TypeError: undefined is not an object (evaluating '_core.pathUtils.urlToPathAndParams') in React-Native

My app was running perfectly but when I pull data from the git repository, I got this error.
I'm not understanding why I'm getting this error. Please help to get rid of this error and explain to me about this error.
The error is TypeError: undefined is not an object (evaluating '_core.pathUtils.urlToPathAndParams')
You may need to install #react-navigation/native.
I tried many time this method but got this error
I delete the node_modules and package-lock.json file and run npm install in terminal but error didn't remove.
The second method:
Then I did some similar steps
I run these commands:
rm -rf node_modules/
yarn install
yarn start --reset-cache
Now the error is gone.
try this one ( second method ) if you also getting these types of error.
This type of error occur because of
in your pull request you might be get some new npm in your
package.json file. so try to do npm install
or
try to remove node_modules and package-lock.json file
do npm install might be solve your problem
I encountered the same problem.
In my case, the reason is that I did not have #react-navigation/core at first, then I installed #react-navigation/core at the newest version, which is not compatible with my old #react-navigation/native.
After I updated my #react-navigation/native to have the same version with #react-navigation/core, the problem is solved.
You may want to check the versions of your #react-navigation components to see if they are compatible.
Check the installed packages
npm ls --depth=0
Install #react-navigation/native if you missing this package.

Error: While trying to resolve module 'prop-types' from file

Error when I run the command react-native run-android. The error was on metro bundler, when, the app is installing on my device, always shows this error.
The curious thing is that only happens me in this PC, I used other PC for a long time and when I pull git repo here (previously I was able to develop and test on that PC too), it's impossible to get it working for this error...
I think that maybe could be I removed yarn.lock many days ago and when I run npm install here produces this error?
I ommited my path for logic reasons:
Loading dependency graph, done.
error: bundling failed: Error: While trying to resolve module `prop-types` from file `PATH_TO_PROJECT_FOLDER\node_modules\react-redux\lib\components\Provider.js`, the package `PATH_TO_PROJECT_FOLDER\node_modules\react-redux\node_modules\prop-types\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`PATH_TO_PROJECT_FOLDER\node_modules\react-redux\node_modules\prop-types\index`. Indeed, none of these files exist:
* `PATH_TO_PROJECT_FOLDER\node_modules\react-redux\node_modules\prop-types\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
* `PATH_TO_PROJECT_FOLDER\node_modules\react-redux\node_modules\prop-types\index\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
at ResolutionRequest.resolveDependency (PATH_TO_PROJECT_FOLDER\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:65:15)
at DependencyGraph.resolveDependency (PATH_TO_PROJECT_FOLDER\node_modules\metro\src\node-haste\DependencyGraph.js:283:16)
at Object.resolve (PATH_TO_PROJECT_FOLDER\node_modules\metro\src\lib\transformHelpers.js:261:42)
at dependencies.map.result (PATH_TO_PROJECT_FOLDER\node_modules\metro\src\DeltaBundler\traverseDependencies.js:399:31)
at Array.map (<anonymous>)
at resolveDependencies (PATH_TO_PROJECT_FOLDER\node_modules\metro\src\DeltaBundler\traverseDependencies.js:396:18)
at PATH_TO_PROJECT_FOLDER\node_modules\metro\src\DeltaBundler\traverseDependencies.js:269:33
at Generator.next (<anonymous>)
at asyncGeneratorStep (PATH_TO_PROJECT_FOLDER\node_modules\metro\src\DeltaBundler\traverseDependencies.js:87:24)
at _next (PATH_TO_PROJECT_FOLDER\node_modules\metro\src\DeltaBundler\traverseDependencies.js:107:9)
DELTA [android, dev] ..\..\../index.android.js ▓▓▓▓▓▓▓▓░░░░░░░░ 51.9% (610/847), failed.
react-native: 0.59.1
react-native-cli: 2.0.1
Well.. I should not have deleted the yarn.lock file.
To fix:
Delete all .lock files on root folder project as #hend-el-sahli said.
yarn install
If you had the error unable to resolve module ./index, see that thread https://github.com/facebook/react-native/issues/24112
:)

How can I fix this react-native iOS error?

error: bundling failed: Error: While trying to resolve module `react-native` from file `/Users/ios/Desktop/android/android/index.js`, the package `/Users/ios/Desktop/android/android/node_modules/react-native/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/ios/Desktop/android/android/node_modules/react-native/Libraries/react-native/react-native-implementation.js`. Indeed, none of these files exist:
* `/Users/ios/Desktop/android/android/node_modules/react-native/Libraries/react-native/react-native-implementation.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
* `/Users/ios/Desktop/android/android/node_modules/react-native/Libraries/react-native/react-native-implementation.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
at ResolutionRequest.resolveDependency (/Users/ios/Desktop/android/android/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:103:15)
at DependencyGraph.resolveDependency (/Users/ios/Desktop/android/android/node_modules/metro/src/node-haste/DependencyGraph.js:272:4579)
at dependencies.map.relativePath (/Users/ios/Desktop/android/android/node_modules/metro/src/DeltaBundler/traverseDependencies.js:376:19)
at Array.map (<anonymous>)
at resolveDependencies (/Users/ios/Desktop/android/android/node_modules/metro/src/DeltaBundler/traverseDependencies.js:374:16)
at /Users/ios/Desktop/android/android/node_modules/metro/src/DeltaBundler/traverseDependencies.js:212:33
at Generator.next (<anonymous>)
at step (/Users/ios/Desktop/android/android/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:313)
at /Users/ios/Desktop/android/android/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:473
at <anonymous>
Did you upgrade your react-native recently? If yes, then that might be the issue.
If not, check your node_modules folder for the file.
If nothing works, Then try this:
Delete the node_modules folder and close the packager.
Then reinstall using the command npm install from your project directory.