Ionic serve unexpectedly closed on macOS X (npm issue) - macos

I installed npm ionic cordova on MacOS X 10.13
sudo npm install -g cordova ionic
Then I ran
ionic serve
and got an error suggesting to do :
sudo chown -R $USER:$(id -gn $USER) /Users/admin/.config
which I did.
And now I can't run ionic serve:
$ ionic serve
> ionic-v1 serve --host=0.0.0.0 --port=8100 --livereload-port=35729 --dev-port=53703 --engine=browser
[v1] ionic-v1[12966]: ../src/node_contextify.cc:627:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[1]->IsString()' failed.
[v1] 1: 0x10003818c node::Abort() [/usr/local/bin/node]
[v1] 2: 0x100037367 node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, char const*, int, v8::Local<v8::Value>*, node::async_context) [/usr/local/bin/node]
[v1] 3: 0x10005c3de node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
[v1] 4: 0x1001f14e8 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [/usr/local/bin/node]
[v1] 5: 0x1001f0811 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/usr/local/bin/node]
[v1] 6: 0x1001f0270 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/bin/node]
[v1] 7: 0x256b62bdc01d
[ERROR] A utility CLI has unexpectedly closed (exit code null).
The Ionic CLI will exit. Please check any output above for error
details.
$ npm i -D #ionic/v1-tookit
npm ERR! code E404
npm ERR! 404 Not Found: #ionic/v1-tookit#latest
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2018-09-06T11_18_15_262Z-debug.log
Here is my info:
$ ionic info
[WARN] Bad integration name: gulp
✔ Gathering environment info - done!
Ionic:
ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic1 1.3.4
#ionic/v1-toolkit : 1.0.8
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)
System:
NodeJS : v10.9.0 (/usr/local/Cellar/node/10.9.0/bin/node)
npm : 6.2.0
OS : macOS High Sierra

I uninstalled cordova, ionic and node, and reinstalled them, including nvm.

Related

Unable to add android platform

I am doing a ionic 6 project having node -v v16.13.1 and npm -v 8.1.2
I did "npm install" and after that when i run "ionic cordova platform add android" i get the below error. I am using Ubuntu Terminal. this happens only if i use node above v10.17.0. Please let me know how to fix this.
**Error: spawn ENOTDIR**
at ChildProcess.spawn (node:internal/child_process:412:11)
at Object.spawn (node:child_process:698:9)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/cross-spawn/index.js:12:24)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/utils-subprocess/dist/index.js:169:12)
at Subprocess.spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/utils-subprocess/dist/index.js:142:16)
at Subprocess.run
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/utils-subprocess/dist/index.js:104:24)
at Shell.run (/usr/local/lib/node_modules/ionic/lib/shell.js:31:34)
at async PlatformCommand.runCordova
(/usr/local/lib/node_modules/ionic/commands/cordova/base.js:122:13)
at async PlatformCommand.run
(/usr/local/lib/node_modules/ionic/commands/cordova/platform.js:77:9)
at async Promise.all (index 0)
Output of my "ionic info" command:
Ionic:
Ionic CLI : 5.4.10 (/usr/local/lib/node_modules/ionic)
Ionic Framework : #ionic/angular 6.1.11
#angular-devkit/build-angular : 13.2.6
#angular-devkit/schematics : 13.2.6
#angular/cli : 13.2.6
#ionic/angular-toolkit : 6.1.0
Capacitor:
Capacitor CLI : 3.5.1
#capacitor/core : 3.5.1
Cordova:
Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : not installed
native-run : 1.6.0
System:
Android SDK Tools : 26.1.1 (/home/etpl41/Android/Sdk)
NodeJS : v16.13.1 (/home/etpl41/.nvm/versions/node/v16.13.1/bin/node)
npm : 8.1.2
OS : Linux 4.4
Regards,
Rupak

Expo classic build for android fail_Expo sdk 44 -show standalone build fail and

i use expo build:android -t apk to build apk file
but always receive below error.
May i know why ? it started happen yesterday. Pervious builds are ok using same expo sdk44. so far ios build is always ok so far.
i logout /in expo cli and try , but not able to build. i try with different expo account also cannot.
Anyone can suggest based on below error log ?
Thank you in advance.
my Environment
expo-env-info 1.0.3 environment info:
System:
OS: Windows 10 10.0.19043
Binaries:
Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6514223
npmPackages:
babel-preset-expo: 9.0.1 => 9.0.1
expo: ^44.0.6 => 44.0.6
react: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-navigation: ^4.3.1 => 4.4.4
Expo Workflow: managed
Error: Request failed with status code 500
at createError (/app/turtle/node_modules/axios/lib/core/createError.js:16:15)
at settle (/app/turtle/node_modules/axios/lib/core/settle.js:17:12)
at RedirectableRequest.handleResponse (/app/turtle/node_modules/axios/lib/adapters/http.js:231:9)
at RedirectableRequest.emit (events.js:387:35)
at RedirectableRequest.emit (domain.js:470:12)
at RedirectableRequest._processResponse (/app/turtle/node_modules/follow-redirects/index.js:426:10)
at ClientRequest.RedirectableRequest._onNativeResponse (/app/turtle/node_modules/follow-redirects/index.js:57:10)
at Object.onceWrapper (events.js:482:26)
at ClientRequest.emit (events.js:375:28)
at ClientRequest.emit (domain.js:470:12)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:647:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
at HTTPParser.execute (<anonymous>)
at TLSSocket.socketOnData (_http_client.js:515:22)
at TLSSocket.emit (events.js:375:28)
at TLSSocket.emit (domain.js:470:12)
at addChunk (internal/streams/readable.js:290:12)
at readableAddChunk (internal/streams/readable.js:265:9)
at TLSSocket.Readable.push (internal/streams/readable.js:204:10)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)

NativeScript + Apple M1 Error: 'arch install' command failed

NativeScript CLI (8.0.2) on Apple M1 CPU/MBP
When running ns run iOS I get this error.
error
'arch install' command failed.
I've tried running it from Rosetta Terminal & (installing Rosetta 2).
Any ideas?
tns prepare ios --log trace
Installing pods...
Running on arm64 - running pod through rosetta2.
spawn: arch "-x86_64" "pod" "install"
arch: posix_spawnp: pod: Bad CPU type in executable
Result when throw error is false:
{ stdout: '', stderr: '', exitCode: 1 }
'arch install' command failed.
Error: 'arch install' command failed.
at Errors.failWithOptions (/opt/homebrew/lib/node_modules/nativescript/lib/common/errors.js:157:27)
at Errors.fail (/opt/homebrew/lib/node_modules/nativescript/lib/common/errors.js:130:21)
at CocoaPodsService.<anonymous> (/opt/homebrew/lib/node_modules/nativescript/lib/services/cocoapods-service.js:55:30)
at Generator.next (<anonymous>)
at fulfilled (/opt/homebrew/lib/node_modules/nativescript/lib/services/cocoapods-service.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Have you tried installing an older version of cocoapods?
For me installing 1.10.2 instead of 1.11 fixed the issue for me.

Cannot run appium tests on iOS simulator - Error : Cannot read property 'statBarHeight' of undefined

I set up appium tests following nativescript-dev-appium instructions (https://github.com/NativeScript/nativescript-dev-appium) and tests run fine on an Android simulator.
My problem is on iOS. I cannot make them work, before and after methods fail with the error Cannot read property 'statBarHeight' of undefined. Here are my logs :
➜ npm run e2e -- --runType sim.iPhone11Pro --reuseDevice
> my-project#1.0.0 e2e /Users/fleebzz/workspaces/xxx/my-project
> node ./node_modules/nativescript-dev-appium/check-dev-deps.js && mocha --opts ./e2e/config/mocha.opts "--runType" "sim.iPhone11Pro" "--reuseDevice"
Parsed args: {"port":4723,"projectDir":"/Users/fleebzz/workspaces/xxx/my-project","projectBinary":"/Users/fleebzz/workspaces/xxx/my-project/node_modules/.bin","pluginRoot":"/Users/fleebzz/workspaces/xxx/my-project/node_modules/nativescript-dev-appium","pluginBinary":"/Users/fleebzz/workspaces/xxx/my-project/node_modules/nativescript-dev-appium/node_modules/.bin","wdaLocalPort":8410,"testFolder":"e2e","runType":"sim.iPhone11Pro","appiumCapsLocation":"/Users/fleebzz/workspaces/xxx/my-project/e2e/config/appium.capabilities.json","verbose":false,"cleanApp":false,"path":"/Users/fleebzz/workspaces/xxx/my-project","capabilitiesName":"appium.capabilities.json","driverConfig":{"host":"localhost","port":4723},"logImageTypes":[]}
/Users/fleebzz/workspaces/xxx/my-project/e2e/config/appium.capabilities.json
Capabilities found at: /Users/fleebzz/workspaces/xxx/my-project/e2e/config/appium.capabilities.json
Automation name set to: XCUITest
To change automation name, you need to set it in appium capabilities!
Application full path: /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa
The started device will be killed after the session quits!
To avoid it, set 'fullReset: false' in appium capabilities.
Is process Simulator.app alive: true
xcrun simctl create "iPhone-11-Pro" "iPhone 11 Pro" "com.apple.CoreSimulator.SimRuntime.iOS-13-5"
Remove: 76B308BE-409C-4A0A-8679-36F670F59118
Check if simulator is booted!
Simulator is booted!
Launched simulator with name: iPhone-11-Pro; udid: 7056B721-AFCA-465F-A65B-E301E21B6DDE; status: booted
Started device: {"token":"7056B721-AFCA-465F-A65B-E301E21B6DDE","name":"iPhone-11-Pro","status":"booted","type":"simulator","apiLevel":"13.5","platform":"ios","createDeviceOptions":{"type":"iPhone-11-Pro"},"pid":75610,"startedAt":1593415466101}
Default device: {
token: '7056B721-AFCA-465F-A65B-E301E21B6DDE',
name: 'iPhone-11-Pro',
status: 'booted',
type: 'simulator',
apiLevel: '13.5',
platform: 'ios',
createDeviceOptions: { type: 'iPhone-11-Pro' },
pid: 75610,
startedAt: 1593415466101
}
Trying to resolve automatically bundleId!
unzip -o /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa -d /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject
Setting capabilities sim.iPhone11Pro{ "bundleId" : "com.xxx.my-project" }!
Setting application name as my-project
Check and uninstall application from device.
Server args: ["-p","4723","--log-level","info"]
sample scenario
args.appiumCaps['wdaLocalPort']: 8410
Session info:
undefined
Appium settings:
Current version of appium doesn't support appium settings!
Could not resolve device density. Please provide offset in appium config
Appium driver has started successfully!
1) "before all" hook
2) "after all" hook
Killing simulator with udid 7056B721-AFCA-465F-A65B-E301E21B6DDE
Executing "/bin/ps aux | grep -ie '7056B721-AFCA-465F-A65B-E301E21B6DDE' | grep -v grep | xargs kill -9"
No matching processes to kill!
Stopping server...
Shut down!!!
About to exit with code: exit
unzip -o /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa -d /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject
Appium terminated due signal: null and code: 1
unzip -o /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa -d /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject
Application from device is uninstalled.
Application from device is uninstalled.
Exited from appium
0 passing (1m)
2 failing
1) sample scenario
"before all" hook:
TypeError: Cannot read property 'statBarHeight' of undefined
at Function.<anonymous> (node_modules/nativescript-dev-appium/lib/appium-driver.js:260:37)
at Generator.next (<anonymous>)
at fulfilled (node_modules/nativescript-dev-appium/lib/appium-driver.js:4:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
2) sample scenario
"after all" hook:
TypeError: Cannot read property 'quit' of undefined
at Context.<anonymous> (e2e/sample.e2e-spec.js:14:22)
at processImmediate (internal/timers.js:456:21)
at process.topLevelDomainCallback (domain.js:137:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! my-project#1.0.0 e2e: `node ./node_modules/nativescript-dev-appium/check-dev-deps.js && mocha --opts ./e2e/config/mocha.opts "--runType" "sim.iPhone11Pro" "--reuseDevice"`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the my-project#1.0.0 e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/fleebzz/.npm/_logs/2020-06-29T07_24_52_063Z-debug.log
I tried to switch to an older version of iOS (12.X instead of 13.X)
I tried with an older version of appium and of nativescript-dev-appium
I tried with another iPhone version (iPhone X) instead of iPhone 11 Pro
Does anybody already have this issue or have any clue about how to resolve this ?

With Node 0.12.2 and npm 2.7.4 ionic installation error on windows 7

I am downloaded the node installation file "node-v0.12.2-x64.msi" for 64 bit windows 7 OS. All node and npm commands are working fine. I checked both the node and npm versions.
But when I try to install ionic by the following command:
npm install -g cordova ionic
Its gives me the following error:
npm WARN engine cordova-js#3.9.0: wanted: {"node":"~0.10.x"} (current: {"node":"
0.12.2","npm":"2.7.4"})
npm WARN engine npm#1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":
"0.12.2","npm":"2.7.4"})
npm WARN engine xmlbuilder#2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {
"node":"0.12.2","npm":"2.7.4"})
npm WARN installMany normalize-package-data was bundled with npm#1.3.4, but bund
led package wasn't found in unpacked tree
npm ERR! tar.unpack untar error C:\Users\Biswarup\AppData\Local\Temp\npm-1484-8b
f97a1e\registry.npmjs.org\request\-\request-2.9.203.tgz
npm ERR! cb() never called!
Biswarup is my username in above all cases.
I check the following links for troubleshooting, but nothing works for me.
https://github.com/npm/npm/wiki/Troubleshooting#error-enoent-stat-cusersuserappdataroamingnpm-on-windows-7
https://github.com/diegonetto/generator-ionic/issues/42
Please guide me, I am totally stuck at that point. Try to removing node js and reinstalling it many times. But nothing goes right.
First of all packages warning you, that it requires nodejs 0.10.x and may be that is a reason.
Another try you can upgrade npm and try to found new version. So here steps to do it:
npm cache clean
npm update -g npm
npm cache clean
Please download Node 0.10.38
I was too having problem with newer version of node.
I have already aswered this in detail https://stackoverflow.com/a/31124491/1276616

Resources