React Native dependency error - node.js

I'm brand new to React Native, I wanted to install an UI toolkit to simplify my UI design process so I went ahead and installed #shoutem/ui. After the installation I ran my application and I got a dependency error:
I went ahead and installed string_decoder (npm install --save string_decoder) so it now shows as a module under my node_modules folder but I still get the same error.
I tried to troubleshoot this by following the steps the error message shows, still getting it. Any suggestions on this?

Maybe, it' from packager cache. start packager with this command:
npm start --reset-cache

React Native v40 had some breaking changes which caused Shoutem UI toolkit not to work. It will be solved in the following days. In the meantime, here is a temporary solution.

Related

create-react-app ; aborting installation while creating react app in windows 11 after installing node js

I installed node js and create-react-app in my system and while performing the command to create the startup react project, i performed, npx create-react-app <projectname> command. But it failed all the time and i don't know how to proceed with this and i tried some of the already available solutions and nothing worked and i don't know how to proceed with this. I have attached the screenshot of the error. Have a look at it and help me with the solution.
create-react-app_click_here_to_see_my_terminal_image
Thanks in advance !!!

NestJs can't find module platform-express even though it's installed in node_modules

I was following a tutorial on Udemy in order to setup a NestJS app from scratch. Upon execution using npx ts-node-dev src/main.ts I get the error [PackageLoader] No driver (HTTP) has been selected. In order to take advantage of the default driver, please, ensure to install the "#nestjs/platform-express" package ($ npm install #nestjs/platform-express).
I tried uninstalling and reinstalling #nestjs/platform-express but I still get same error.
Finally solved this issue, I had to delete the entire node_modules folder and then run npm install with the same pckage.json file.

An unhandled exception occurred: Cannot find module './browsers' -

I looked for other questions available on stack but was not able to find ans related to this issue.
I have just started Angular and installed things as asked on Udemy course. Creating app and then starting with ng serve.
While I am running ng serve, I am getting below error.
After running npm install I am getting below message.
Can you please guide me to solve this error ?
Thank you very much in advance. :)
well try this one it works for me: npm install --save-dev #angular-devkit/build-angular
If the error message persists after installing packages, it may be due to the NPM settings. In recent versions of the package manager, by default it only installs the packages needed for the production version of the project. The "build-angular" package is a development dependency. If you want to make the website work, you have to tell NPM to install the development packages, by adding the "--only" option with the "dev" version so you should use this command instead:npm i --only=dev
Thank you for above answers.
With below steps followed including avoiding few mistakes, I was able to make it work.
Installed packages in C drive instead of my application folder.
Deleted my old app and recreated it from scratch.
And then when I gave "ng serve" it ran fine.

Getting started with Create React App - "Cannot find module"

I'm using the "Getting Started" guide because I've been experiencing endless errors trying to create a react app so far when following tutorials.
And straight away I'm running into a problem. When I run npx create-react-app my-app I get the following:
Cannot find module 'C:\Users\Aristophanes\node_modules\create-react-app\index.js'
Can anyone advise me what I'm doing wrong? Thanks.
This must be a problem related with your node installation (maybe you removed manually create-react-app package?). I'd recommend following these steps:
Uninstall node and npm
Delete the npm cache and npm modules in your machine (In Windows machine you can usually find them at C:\Users\ {username} \AppData\Roaming\npm-cache and C:\Users\ {user name} \AppData\Roaming\npm) respectively.
Install node and npm again
If you really don't want to delete node and npm, try step 2 and see if that works. Following these steps did the job for me, hope that helps you.
I think you might miss installing Node and npm in your machine.
I had same issue a few times. Every time I was searching thru net for a solution, and for every time i just typed in terminal
npm i node
and its just started working

React Native starter project bundling fails with Unexpected Token error

I'm trying to create my first React Native app for Android using the instructions on https://facebook.github.io/react-native/docs/getting-started.html. After setting up the dependencies and connecting my Android device, I ran
react-native init app
cd app
react-native run-android
This starts the React Packager, which fails to bundle with this error:
error: bundling failed: "TransformError: /Users/luky/dev/app/index.android.js: Unexpected token ) (While processing preset: \"/Users/luky/dev/app/node_modules/babel-preset-react-native/index.js\")"
I am using:
OSX El Capitan 10.11.6.
node version 6.9.2
react-native version 0.47.1.
I pushed my generated project, including node_modules, to Github in case it helps: https://github.com/luky1971/react-native-app
Does anyone know why I might be getting an Unexpected token error? Any help would be greatly appreciated!
I got the same thing, it looks like the latest version of the babel preset for react native has some bugs (version 3.0.0). I went into my package.json and replaced the latest version with this:
"babel-preset-react-native": "2.1.0".
then I deleted the node_modules directory and ran npm install and it worked.
Install babel-preset-react-native#2.1.0 and run the project.
In the current project, do this...
yarn remove babel-preset-react-native
yarn add babel-preset-react-native#2.1.0
This worked for me, I hope it will for you too.
You can find more information about the error here https://github.com/facebook/react-native/issues/15513#issuecomment-322824346
Try deleting the .babelrc file in the root directory. Or rename it. Then re-run the "react-native run-android" command. This worked for me. Good luck.
Looking for JS files in
/Users/admin/Desktop/CoinMarketCap
React packager ready.
Loading dependency graph, done.
Bundling `index.ios.js` [development, non-minified, hmr disabled] 0.0% (0/1), failed.
error: bundling failed: "TransformError: /Users/admin/Desktop/CoinMarketCap/index.ios.js: Unexpected token ) (While processing preset: \"/Users/admin/Desktop/CoinMarketCap/node_modules/babel-preset-react-native/index.js\")"
iMac-D001:CoinMarketCap admin$ react-native --v
react-native-cli: 2.0.1
react-native: 0.47.1
Fixed it for me:
https://github.com/facebook/react-native/issues/15545
iMac-D001:CoinMarketCap admin$ npm uninstall babel-preset-react-native
iMac-D001:CoinMarketCap admin$ npm install babel-preset-react-native#2.1.0
I cloned your project. It is working fine. You can delete node_modules folder, then npm_install. It will work fine.
Try to set a new project, choosing the version of react-native as below:
react-native init --version="0.55.0" MyNewApp
Go to the new project directory.
CD project_name
Open the app in android studio. Open the AVD manager emulator and choose the virtual device. Then execute this command back there on the prompt:
react-native run-android
This worked for me. Hope it can help you too.
It could also be because of a dependency that you're using and needs to be put in the preset of your babel.config.js
e.g. I ws using expo, then ejected. And one of the dependency was react-native-paper for which I had to change the babel.config.js file to get it working.

Resources