INJI Mobile not able to npm install getting error

E:\inji-main\inji-main>npm install
npm ERR! code 1
npm ERR! The git reference could not be found
npm ERR! command git --no-replace-objects checkout initial
npm ERR! error: pathspec ‘initial’ did not match any file(s) known to git

npm ERR! A complete log of this run can be found in: C:\Users\dell\AppData\Local\npm-cache_logs\2024-03-12T05_17_28_858Z-debug-0.log

Hi @mohdrazacs

Thanks for sharing the logs our team will look into this and let you know why the issue with NPM installation is coming. @swatigoel Please check this and provide the solution.

Best Regards,
Team MOSIP

Hi @mohdrazacs
Can you help me to understand which OS you are using to build the Inji app - It’s Mac or Windows?
We have defined build and deployment steps here Build & Deployment - Inji
Have you followed these steps and installed all required dependencies?

1 Like

I am using OS Window

Have you followed all the steps and installed required dependencies mentioned here Build & Deployment - Inji

Steps mentioned for Windows are already verified and working

1 Like

I followed all the steps but still the issue was not resolved. Can I get help through Teams meetings or any other?

Hi @mohdrazacs ,
can you please try following steps once:

  1. npm cache clean -f
  2. rm -rf node_modules
  3. npm install

npm already installed successfully, getting another issue.

try that step also 1. npm cache clean -f
2. rm -rf node_modules
3. npm install

mosip-resident-app@1.0.0 android:mosip
react-native run-android --variant=residentappDebug

info Starting JS server…
warn “variant” flag is deprecated and will be removed in future release. Please switch to “mode” flag.
info Installing the app…

Configure project :expo-barcode-scanner
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

Configure project :expo-font
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

Configure project :expo-image-loader
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

Configure project :expo-local-authentication
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

Configure project :expo-localization
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.
5 actionable tasks: 2 executed, 3 up-to-date

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where:
    Script ‘E:\All Workspaces\Android Workspace\MOSIP\inji\node_modules\expo-modules-autolinking\scripts\android\autolinking_implementation.gradle’ line: 273

  • What went wrong:
    A problem occurred evaluating project ‘:expo’.

A problem occurred configuring project ‘:expo-modules-core’.
Failed to notify project evaluation listener.
The filename, directory name, or volume label syntax is incorrect
Could not get unknown property ‘release’ for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:expo’.

compileSdkVersion is not specified. Please add it to build.gradle

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 2m

error Failed to install the app. Make sure you have the Android development environment set up: Setting up the development environment · React Native.
Error: Command failed: gradlew.bat app:installResidentappDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where:
    Script ‘E:\All Workspaces\Android Workspace\MOSIP\inji\node_modules\expo-modules-autolinking\scripts\android\autolinking_implementation.gradle’ line: 273

  • What went wrong:
    A problem occurred evaluating project ‘:expo’.

A problem occurred configuring project ‘:expo-modules-core’.
Failed to notify project evaluation listener.
The filename, directory name, or volume label syntax is incorrect
Could not get unknown property ‘release’ for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:expo’.

compileSdkVersion is not specified. Please add it to build.gradle

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 2m

at makeError (E:\All Workspaces\Android Workspace\MOSIP\inji\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at E:\All Workspaces\Android Workspace\MOSIP\inji\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (E:\All Workspaces\Android Workspace\MOSIP\inji\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
at async Command.handleAction (E:\All Workspaces\Android Workspace\MOSIP\inji\node_modules\@react-native-community\cli\build\index.js:108:9)

info Run CLI with --verbose flag for more details.

1 Like

It looks like some issue with expo linking. Can you please try this command once
npm i expo-modules-autolinking@~1.1.0
Once this autolinking module is installed, rebuild the App.

1 Like

How you resolved this issue? i am facing the same issue and not able to fix this.

@swatigoel Can you help here please. Following is the error log.

8175 verbose stack Error: The git reference could not be found
8175 verbose stack at makeError (C:\Users\YV351VA\AppData\Roaming\nvm\v16.19.0\node_modules\npm\node_modules@npmcli\git\lib\make-error.js:26:13)
8175 verbose stack at C:\Users\YV351VA\AppData\Roaming\nvm\v16.19.0\node_modules\npm\node_modules@npmcli\git\lib\spawn.js:37:26
8175 verbose stack at runMicrotasks ()
8175 verbose stack at processTicksAndRejections (node:internal/process/task_queues:96:5)
8175 verbose stack at async C:\Users\YV351VA\AppData\Roaming\nvm\v16.19.0\node_modules\npm\node_modules\pacote\lib\git.js:262:19
8175 verbose stack at async Object.withTempDir (C:\Users\YV351VA\AppData\Roaming\nvm\v16.19.0\node_modules\npm\node_modules@npmcli\fs\lib\with-temp-dir.js:23:14)
8175 verbose stack at async Promise.all (index 106)
8175 verbose stack at async Arborist.[buildDepStep] (C:\Users\YV351VA\AppData\Roaming\nvm\v16.19.0\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:1046:5)
8175 verbose stack at async Arborist.buildIdealTree (C:\Users\YV351VA\AppData\Roaming\nvm\v16.19.0\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:211:7)
8175 verbose stack at async Promise.all (index 1)
8176 verbose cwd C:\Users\YV351VA\inji
8177 verbose Windows_NT 10.0.19045
8178 verbose node v16.19.0
8179 verbose npm v8.19.3
8180 error code 1
8181 error The git reference could not be found
8182 error command git --no-replace-objects checkout initial
8183 error error: pathspec ‘initial’ did not match any file(s) known to git
8184 verbose exit 1
8185 timing npm Completed in 1106886ms
8186 verbose unfinished npm timer reify 1712071812802
8187 verbose unfinished npm timer reify:loadTrees 1712071812819
8188 verbose code 1
8189 error A complete log of this run can be found in:
8189 error C:\Users\YV351VA\AppData\Local\npm-cache_logs\2024-04-02T15_30_11_188Z-debug-0.log

It looks like your directory where code is cloned is corrupted hencd not able to get git reference.

Can you help me with steps you followed starting from cloning the repo?

You can even try cloning into new directory and run npm install

1 Like

After rerunning from scratch in a new directory, getting following error while running npm run android:mosip

FAILURE: Build failed with an exception.

           > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5.1/userguide/build_environment.html#gradle_system_properties
              > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Hi @sas78776 ,
Let us schedule a session to resolve this problem. We will let you know the availability.

Hi @sas78776
as per our conversation over call and email, I think this issue is resolved for you right?
Can you please update the status of this issue if you are still facing this issue?

Issue is resolved now. Thanks,