React native, pass index.ios.js path to package manager - ios

I'm writing a small POC for my learning benefit. MI want to prove that I can share business logic to a web app and it's react native counterpart. The repo mis below.
https://github.com/danfernand/rate-topic
Essentially under src folder I have a web and native folders. In that folder I have all my actions/reducers/utils.
I installed react-native as a dependency and am using the following run command.
export BABEL_ENV=native && npm run clean && ./node_modules/react-native/packager/packager.sh --project-path './src/native/' --reset-cache
I have tried all that I can find online but can't seem to be able to set the folder where the index.ios.js is. I get an error by the package manager.
Cannot find entry file index.ios.js in any of the roots: ['']
How can I fix this issue?

Find this in another stackoverflow question.
Apparently you just need to use --root
Credit where its due
React cannot find entry file in any of the roots

Related

No such module 'SomeModule' after liking plugin to Capacitor app

I cannot seem to find a real solution for my problem anywhere.. After following the Capacitor documentation and creating successfully an app as well as a plugin, i've linked them both using the following commands:
in plugin directory:
-npm run build
-npm link
in app's directory:
-npm link plugin-name
-npm install
-npx cap sync
I open the app's workspace and want to run it on my device but instead I am getting an error in the added plugin of the app, that a certain library I'm using in it does not exist.
p.s
Plugin builds normally and has no issues. This occurs only after I'm linking both plugin and app. Am I doing something wrong?
The error I'm getting inside the plugin's file.
Those are the frameworks linked to the capacitor app.
As of this moment I have solved the issue I had. Shamefully there aren't really any precise documentation regarding the subject so I'll try to answer as best I can:
My issue got resolved when I updated the dependencies inside the .podspec file inside my plugin's folder.
The specific package I wish to use with the plugin, should be specified inside the .podspec file i.e. :
s.dependency 'PicUPSDKv3' should be added.
After running -npx cap sync on my main project's folder, all pods were initialized correctly and I was able to build and run the project alongside the plugin without any errors.
Running npm install unlinks whatever is linked.
You should change the order, first npm install and then npm link plugin-name.
But it's better if instead of linking the plugin you install it from its local folder.

Installation with Create React App

I'm sorry for asking what may be an obvious question to most, but I'm lost. I have created a react project with create-react-app. I want to add a third party library (Ant Design UI Framework) that uses .css styles. Ant will use global .css and the rest of my application can then use styleName.
After running npm install babel-plugin-react-css-modules --save what do I have to do to get this running? The documentation references the configuration but the individual steps required properly configure the app aren't clear at all—at least to me.
Can someone help with a bit of an "idiot's guide" to setting this up, and detail some of the steps?
Thanks,
Chris
Ant Design also have react native library as you can see here
You just need to run the following command on your project root to install it:
$ npm install antd-mobile --save

How to write an Electron app with Hyper?

I was wondering, how can I start to write an Electron app using the Hyper.js sources?
I am new to both Electron and Hyper, and watched a few videos on building an Electron app. But I can't quite figure out how to start the Hyper app. For instance, which is the "main" file in the sources?
Alright, after more reading and getting familiar with Node.js and Electron apps, the following procedure works:
git clone https://github.com/zeit/hyper
cd hyper
npm install
A lot of packages will be installed in a subdirectory called node_modules, then:
yarn run dev
And (in a separate terminal window):
yarn rup app
This will open an Electron app similar to the original one built by Hyper.

React Native iOS app setup without using default ./ios directory

I'm integrating React Native into a pre-existing iOS application. Since it's a long-standing git repo, I need to keep the directory structure intact. So instead of having the iOS app files like .xcworkspace in ./ios, I need to have them in the root of the repo ./. I have my React Native components in a directory called ./ReactComponents, and I run:
(JS_DIR=`pwd`/ReactComponents; cd ReactComponents/node_modules/react-native; npm run start — — root $JS_DIR)
It seems to start the server fine, but when I then build from Xcode and navigate to the React Native screen, I get:
TransformError: {my_machine}/react-native/ios/ReactComponents/index.ios.js: Couldn't find preset "react-native" relative to directory "{my_machine}/react-native/ios"
What am I missing to ensure that npm knows where to look for the js files?
I'm using React Native 0.45.1 btw
Thanks!
I've figured it out - it was a babel issue. In babel-preset-react-native's package.json, I had to change the default /ios to /ReactComponents.

ionic build ios fails with "[TypeError: Arguments to path.join must be strings]"

I am trying to create an ionic app on Mac.
I followed the instructions on ionic's website to create a basic app and was able to run it in the browser but when I run "ionic build ios" I get following error. I cannot find a log file or any other error to debug this. How do I go about fixing this?
Check your Gulp version and gulpfile.js. You may need to remove the calls to gulp.src
See:
Gulp TypeError: Arguments to path.join must be strings
and
https://github.com/sindresorhus/gulp-ruby-sass/issues/191
ok, after lot of looking and searching I figured my npm install was messed up.
Part of my installs were in /usr/local and few of them were in /User/user.name/npm folders. /Users/user.name/npm was set in the npm config prefix.
I had two installs of cordova, one on each folder above. Some how the cordova from /usr/local was getting used to create the project and that was the old version.
To fix the problem, I uninstalled all my global npm installs and pointed my npm config prefix to /usr/local and gave myself execute permission on that folder. Everything is working now.
Here is the video that explains how to do it: https://docs.npmjs.com/getting-started/fixing-npm-permissions

Resources