expo init gives the error "× Something went wrong while downloading and extracting the template. npm exited with non-zero code: 1" - expo

so I am trying to get started with react native
when I tried running expo init it gave me the following error:
√ What would you like to name your app? ... test
√ Choose a template: » minimal
× Something went wrong while downloading and extracting the template.
npm exited with non-zero code: 1
Error: npm exited with non-zero code: 1
any fixes?

Sort of outdated but figured out that I can use a docker container or WSL.

Related

Failed to deploy hyperledger-fabric

this is my first time deploy hyperledger in my machine. i follow the tutorial from this. i already installed go version 1.19 and just download docker. when i try to run this command ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go i got an error
Error: failed to read chaincode package at 'basic.tar.gz': open basic.tar.gz: no such file or directory
PACKAGE_ID=
Error: failed to normalize chaincode path: 'go list' failed with: error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.: exit status 1
i already try to use this command go env -w GO111MODULE=auto and still got nothing.
i am using go version go1.19.5
i hope i can just to deploy the tutorial.

Failed to Run ReactNative App after converting expo app into react-native

This is mentioned that firstly I have created a react-native application using expo init ProjectName and it's run on my device what I wanted. But I am failed to make an APK file from this react native app (expo init ProjectName). This is why I wanna to create a react native using npx react-native init ProjectName and copy all the source code, app.js, package.json, and assets. After moving all the files I have used npm install --force because it's failed to install when I have used npm install. And then I have faced the error to run this code and the error is given bellow,
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1839 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
WARNING:: Please remove usages of `jcenter()` Maven repository from your build scripts and migrate your build to other Maven repositories.
This repository is deprecated and it will be shut down in the future.
See http://developer.android.com/r/tools/jcenter-end-of-service for more information.
Currently detected usages in: project ':react-native-picker_picker', project ':react-native-safe-area-context', project ':react-native-screens'
> Task :react-native-community_datetimepicker:compileDebugJavaWithJavac FAILED
66 actionable tasks: 61 executed, 5 up-to-date
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
D:\ReactNative\CovidVisa\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDatePickerDialogModule.java:23: error: package com.facebook.react.modul
e.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^
D:\ReactNative\CovidVisa\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDatePickerDialogModule.java:31: error: cannot find symbol
#ReactModule(name = RNDatePickerDialogModule.FRAGMENT_TAG)
^
symbol: class ReactModule
D:\ReactNative\CovidVisa\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNTimePickerDialogModule.java:13: error: package com.facebook.react.modul
e.annotations does not exist
D:\ReactNative\CovidVisa\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDateTimePickerPackage.java:12: error: com.reactcommunity.rndatetimepick
er.RNDateTimePickerPackage is not abstract and does not override abstract method createJSModules() in com.facebook.react.ReactPackage
public class RNDateTimePickerPackage implements ReactPackage {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
5 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-community_datetimepicker:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Note: The error is also given on the attached file, please concern about that. Advanced Thanks!

npx mrm lint-staged erroring out with 'Preset "default" not found."

Example of the issue:
❯ npx mrm lint-staged
npx: installed 298 in 9.141s
Preset “default” not found.
We’ve tried to load “mrm-preset-default” and “default” npm packages.
Can't run this command and I don't know why!
The problem is within mrm which is currently in version 3 that seems to be incompatible with lint-staged, to fix this you got to specify mrm version 2 by running npx mrm#2 lint-staged

Why am I getting this error in AWS Device farm? Tests skipped due to test package parsing error. Please check Parsing result for more details

In AWS Device Farm, I created a new run. I chose native application. I uploaded my APK. I chose Calabash as the tests. I got this error message:
Tests skipped due to test package parsing error. Please check Parsing result for more details.
I downloaded the Parsing result. Here's what it said:
Failed to run cucumber dry-run command. See the information below for more details.
Here are the contents for the Parsing result:
'cucumber --dry-run --format json --out /tmp/scratchvxnAeX.scratch/tmpF6f5Xx' failed.
Could not find proper version of cucumber (2.99.0) in any of the sources
Run `bundle install` to install missing gems.
Solution
I have some .rb page objects. I added require 'calabash-android' to the top of those files. Then I made a new run and ran it. It worked.
How I got to the solution
Through Google I came across CALABASH_TEST_PACKAGE_DRY_RUN_FAILED here.
Running this command failed: cucumber-ios --dry-run --format json features
I figured that was for ios. So I tried this: bundle exec calabash-android run .\app-releaseStaging.apk --dry-run. I got this error:
uninitialized constant Calabash::ABase (NameError)
I wasn't getting that error when running locally.
According to this:
-d, --dry-run Invokes formatters without executing the steps. This also omits the loading of your support/env.rb file if it exists.
I had require 'calabash-android' inside env.rb. So I moved it to my page objects. Then it worked.
You may find the aws-device-farm-calabash-tests-for-sample-app useful.

Google Cloud Container Build trigger crashes during gradle build

I was trying to setup a build trigger for an kotlin app that is build using gradle. For that I put together the following Dockerfile:
FROM gradle:jdk8 as builder
WORKDIR /home/gradle/project
COPY . .
WORKDIR ./Kuroji-Eventrouter-Server
RUN gradle shadowJar
FROM openjdk:8-jre-alpine
WORKDIR /app
COPY --from=builder /home/gradle/project/Kuroji-Eventrouter-Server/build/libs/kuroji-eventrouter-server-*-all.jar kuroji-eventrouter-server.jar
ENTRYPOINT ["java", "-jar", "kuroji-eventrouter-server.jar"]
And that file works on my machine with docker build and it starts normally on google container registry however during the RUN gradle shadowJar task it crashes with some gradle error:
Step 5/9 : RUN gradle shadowJar
---> Running in ddd190fc2323
Starting a Gradle Daemon (subsequent builds will be faster)
[91m
[0m[91mFAILURE: [0m[91mBuild failed with an exception.[0m[91m
[0m[91m
[0m[91m* What went wrong:
[0m[91mCould not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
[0m[91m> [0m[91mCould not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().
[0m[91m
[0m[91m* Try:
[0m[91mRun with [0m[91m--stacktrace[0m[91m option to get the stack trace. Run with --info[0m[91m or --debug[0m[91m option to get more log output. Run with [0m[91m--scan[0m[91m to get full insights.[0m[91m
[0m[91m
[0m[91m* Get more help at https://help.gradle.org
[0m[91m
[0m[91mBUILD FAILED in 3s
The command '/bin/sh -c gradle shadowJar' returned a non-zero code: 1
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1
[0m
I tried building the Image on docker HUB and the same thing happend: https://hub.docker.com/r/usbpc/kuroji-eventrouter-server/builds/bnknnpqowwabdy82ydxiypc/
This is very confusing to me as I thought containers should be able to run anywhere and not depend on the enviroment. What can I do to make google build my container?
The problem was a file permission problem. Using the --stacktrace option I found that the gradle process didn't have permissions to create a folder inside the sources.
The solution I would like to do is use the --chown=gradle:gradle option on the COPY instruction, unfortunatly this it not supported in the google cloud yet.
So the solution is to add USER root before executing the gradle build.