Command failed with exit code 2 in ionic - ionic-framework

I HAVE THIS ERROR
On build app in ionic
sudo ionic build android
Error: ANDROID_HOME is not set and "android" command not in your PATH.
You must fulfill at least one of these conditions.
at /home/sbh/testt/mobilebra/platforms/android/cordova/lib/check_reqs.js:206:19
at _fulfilled (/home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:760:13)
at /home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:821:14
at flush (/home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:422:7)
Error: /home/sbh/testt/mobilebra/platforms/android/cordova/build:
Command failed with exit code 2

Do the following:
(nano is my preference, use whatever your heart desires)
sudo nano ~/.bashrc
add the following lines, modifying the paths if your SDKs in a different spot:
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Related

VUE 3 - weird failure in VS Code and flawless running in console

Windows 10 x64 21H2, running my project in VS Code and get the following error:
Executing task: npm run serve
> weatherApp#0.1.0 serve
> vue-cli-service serve
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
INFO Starting development server...
10% building 2/5 modules 3 active ...babel-loader\lib\index.js!C:\tmp\VUE Weather apps\VUE 3 - weather\node_modules\eslint-loader\index.js??ref--13-0!C:\tmp\VUE Weather apps\VUE 3 - weather\src\main.jsError: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:\tmp\VUE Weather apps\VUE 3 -
...
{
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.12.1
* The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run serve" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
At the same time the command npm run serve runs w/o any issues. What should I do to have the issue fixed?

How to setup tRPC project with pnpm

I am trying to learn from this repo.
Step 3 of the setup instructions says to run yarn dx.
The package.json for this repo defines that script as:
"dx": "run-p dx:* --print-label",
When I try to do this, I get an error message that says:
yarn dx yarn run v1.22.19 $ run-p dx:* --print-label [dx:next
] $ run-s migrate-sqlite generate-sqlite db-seed && next dev
[dx:prisma-studio] $ pnpm prisma-studio-sqlite [dx:prisma-studio]
/bin/sh: pnpm: command not found [dx:prisma-studio] error Command
failed with exit code 127. [dx:prisma-studio] info Visit
https://yarnpkg.com/en/docs/cli/run for documentation about this
command. ERROR: "dx:prisma-studio" exited with 127. error Command
failed with exit code 1.
I'm not sure what pnpm means, or why prisma is trying to link to sqlite when the db it specifies is psql.
Can anyone point me in the direction of what's required to get this repo to start?
If you use yarn, change any occurrence in the package.json from pnpm to yarn and I think it should work :)

How to make the kline node js command work?

I try to execute the node kline command, but it gives me an error:
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'C:\Program Files\nodejs\kline'
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}
Although npm install kline was successful. Tell me, maybe I missed something.
From what I gathered the kline module doesn't seem to be designed for the command line. Besides this to install a package which should run from the command line, e.g. nodemon, you should add the -g flag to the npm install command. This will install your package in the global npm scope which also supports calling these packages as a command, if supported.

How to change CLI arguments of Jest Runner using VSCode

I'm switching from MacOS to Windows WSL2 Ubuntu subsystem.
I want to run a basic Jest test from VSCode, with the JestRunner plugin :
When I click on the "Run" button, it opens a terminal on VSCode (WSL not PowerShell), but it automatically launches this command
vincent#LAPTOP-xxxxx:~/Development/Labomaton/packages/api/node_modules$ node "//wsl$/Ubuntu-20.04/home/vincent/Development/Labomaton/packages/api/node_modules/jest/bin/jest.js"
"//wsl$/Ubuntu-20.04/home/vincent/Development/Labomaton/packages/api/src/user/infrastructure/rest/pipes/create-user-validation.spec.ts"
-t "Register user into Labomaton missing firstname"
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/wsl$/Ubuntu-20.04/home/vincent/Development/Labomaton/packages/api/node_modules/jest/bin/jest.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
So I try to run the same command with the correct path to this node module:
vincent#LAPTOP-xxxxx:~/Development/Labomaton/packages/api/node_modules$ node "/home/vincent/Development/Labomaton/packages/api/node_modules/jest/bin/jest.js"
"/home/vincent/Development/Labomaton/packages/api/src/user/infrastructure/rest/pipes/create-user-validation.spec.ts"
-t "Register user into Labomaton missing firstname"
PASS ../src/user/infrastructure/rest/pipes/create-user-validation.spec.ts
Register user into Labomaton
✓ missing firstname (5 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 2.313 s
My question is: how to change the path as an argument to this VSCode JestRunner feature?

Fail to initialize IBM Blockchain Platform on VS Code

Failed to activate extension: Failed to execute command "npm" with arguments "rebuild, grpc, --target=7.1.11, --runtime=electron, --update-binary, --fallback-to-build, --target_arch=x64, --dist-url=https://atom.io/download/electron" return code 1
Could not rebuild native dependencies Failed to execute command "npm" with arguments "rebuild, grpc, --target=7.1.11, --runtime=electron, --update-binary, --fallback-to-build, --target_arch=x64, --dist-url=https://atom.io/download/electron" return code 1. Please ensure that you have node and npm installed
PS C:\Users\k> code --version
1.44.2
PS C:\Users\k> node --version
v10.20.1
PS C:\Users\k> npm --version
6.14.4
I've installed all the dependencies and for some reason VS Code is failing to initialize.