0

In my project, we use react-native-azure-ad plugin. The problem is, this plugin at npm is outdated and use a deprecated way of accessing webview which has already been extracted from react-native to react-native-webview.

When I browsed the github page and observe the source code there, it looks like the code on the github is already updated to use react-native-webview, which lead me to believe that the npm package is not updated by the author to follow the github version.

There's only one way to fix this, that is by downloading the module directly from github and import it manually. The problem is, I only know how to import the module from installing by npm.

Currently, this is the basic folder structure:

Root
- node_modules  
- src  --> the app source code

I want to put the module like this:

Root
- node_modules
- node_updates
  - react-native-azure-ad
- src

And I want to still be able to import it like this:

import {ReactNativeAD, ADLoginView} from 'react-native-azure-ad'

Of course I will remove the react-native-azure-ad from package.json and reinstall the node_modules afresh beforehand.

Is this possible?

I'm hoping that I don't have to rely on relative path like:

import {ReactNativeAD, ADLoginView} from '../../../node_updates/react-native-azure-ad'

I have seen some answers like this, but this requires me to use relative path to import.

Chen Li Yong
  • 5,459
  • 8
  • 58
  • 124

1 Answers1

0

using npm:

npm install <git-host>:<git-user>/<repo-name>

or

npm install <git repo url>

when using public git repo.

using yarn:

yarn add <git remote url>

or yarn add <git remote url>#<branch/commit/tag> when you need specific branch or etc.

Vahid Alimohamadi
  • 4,900
  • 2
  • 22
  • 37