unable to install react-open-weather (SPA - AEM ) custom component - reactjs

I was following this documentation To create a custom component(open weather) in SPA and map it to AEM.
I'm following the above documentation to install that component as a npm dependancy using this command 'npm i react-open-weather', but i am getting errors while installing that component, i have tried this command with --force, or --legacy-peer-deps still my problem doesn't get resolved.
I got struck here can anyone help me to get out of this problem.

Related

errors while install material-ui

I am trying to install material ui but I am facing multiple errors. I am making a website that has a map on it to show different outlets but when I try to install material ui and google maps api, I am facing many errors.
Command I am trying to run -
$ npm install #material-ui/core #material-ui/icons #material-ui/lab #react-google-
maps/api axios google-map-react
Error - Errors in terminal
This error comes on npm V8.x.x . To resolve
run the command below:
npm config set legacy-peer-deps true
You can find more about it here

React JS - warnings while running the npm add gh-pages command

I am trying to add gh-pages to my project but failed to succeed , getting the below warnings.
please find the below image link
Looking carefully at the error, you can notice there are two dependencies requiring to have babel and typescript listed on your dependencies in order to work.
You should then be able to fix your problem by simply running:
npm i --save-dev #babel/core^7.13.0 typescript

Unable to resolve a dependency in react native maps?

Problem:
I have create react native application. There I am using react-native-maps. When bundle is building it laves this error on the console.
Unable to resolve "./lib/components/MapHeatmap.js" from
"node_modules\react-native-maps\index.js"
I look for a solution but I was unable to do so. And I have not any clue for what should do for this error.Thank you
i had the same error just now, try sudo npm uninstall react-native-maps and install it again with expo comand (if you are using expo).
I was also facing the same issue in react native (expo)
For me clearing the cache worked...
just type this command
expo start -c
in cli project run this command on your project
npm cache clean --force
then reinstall the node module ......
then npm install

Not able to run react app after gridstack.js

I want to use gridstack.js in my react app to manipulate the grid functionality. But after importing gridstack, npm i react-gridstack, i am having the issues which i am not able to resolve. I did the install on new project as well but did not work. Any clues will be appreciated
npm start
Issue:
Failed to compile.
./node_modules/gridstack/dist/gridstack.js
Module not found: Can't resolve 'jquery-ui/data' in '/home/rbatra/Desktop/react-app/dynamicreact/node_modules/gridstack/dist'

Cannot read property '#global' of undefined - NPM link MUI components

I have created a number of React components which wrap Material-UI components and are packaged as an NPM module.
The module works fine when installed via the remote package: npm install *name-of-package*, or via local install: npm install ../*name-of-package*.
For module development, however, I would like to use npm link so that I can use webpack --watch / webpack-dev-server etc in the module and site directories.
To do so, I am running npm link to create a symlink in the module directory, and then npm link *name-of-package* in the site directory. Webpack starts as expected, however I keep encountering errors in the browser related to MUI's withStyles function:
Uncaught TypeError: Cannot read property '#global' of undefined referring to the var rules = style[propKey]; line of the function handleNestedGlobalContainerRule(rule).
And other such as: The above error occurred in the <WithStyles(Typography)> component
From what I can tell from similar posts this is complaining about the absence of theme object (the site has a MuiThemeProvider with a theme object declared).
Can anyone suggest why this might be working with npm install and not npm link? I cannot seem to figure this one out.
After checking out various commits and reading #AstenMies' reference, I have seemed to have resolved this issue. Or at least I'm no longer able to replicate the problem.
I'm not entirely sure which exact change solved the issue, but I'll list what I did in case someone else finds themselves in this situation:
As #AstenMies' link points to, property in my theme object was undefined (although this on its own didn't solve my issue)
Make sure the React and React-DOM versions of your module and site are the same
Don't mix your yarn add and npm install commmands - mixing package managers can lead to inconsistencies
When in doubt, delete your node_modules folder and install again. Your can also npm cache clean here to avoid any cached nasties

Resources