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
Related
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 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.
I've done a fresh install of Nativescript on a new iMac (running Big Sur) following the instructions carefully (from https://docs.nativescript.org/environment-setup.html#macos-ios).
It was working fine after the install yesterday, but today I cannot run apps in ios simulator (or in an Android virtual device).
The ns doctor command in terminal gives me this initially:
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.5.1 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.0.2 version and is up to date.
However, when I create a new app (ns create) and then try to run in (ns run ios), I get this error: Executing webpack failed with exit code 1.
The error messages start with this: TypeError: Cannot read property 'resolved' of undefined.
The same thing is also happening when I try to run it on Android.
After trying to run it on both ios and Android, ns doctor adds these lines:
✔ Component #nativescript/core has 8.0.8 version and is up to date.
✔ Component #nativescript/ios has 8.0.0 version and is up to date.
✔ Component #nativescript/android has 8.0.0 version and is up to date.
So it seems like the platforms are being added properly.
Any help would be greatly appreciated!
The full error message is:
Searching for devices...
Preparing project...
webpack is watching the files...
/Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:817
if (entry.resolved !== undefined) return entry.resolved;
^
TypeError: Cannot read property 'resolved' of undefined
at getResolvedTimestamp (/Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:817:12)
at /Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:1167:21
at /Users/student/Desktop/testApp/node_modules/webpack/lib/util/AsyncQueue.js:352:5
at Hook.eval [as callAsync] (eval at create (/Users/student/Desktop/testApp/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/student/Desktop/testApp/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
at AsyncQueue._handleResult (/Users/student/Desktop/testApp/node_modules/webpack/lib/util/AsyncQueue.js:322:21)
at /Users/student/Desktop/testApp/node_modules/webpack/lib/util/AsyncQueue.js:305:11
at /Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:3098:21
at /Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:3010:22
at /Users/student/Desktop/testApp/node_modules/neo-async/async.js:2830:7
at done (/Users/student/Desktop/testApp/node_modules/neo-async/async.js:2925:13)
at /Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:2994:23
at Array.<anonymous> (/Users/student/Desktop/testApp/node_modules/webpack/lib/util/fs.js:311:21)
at runCallbacks (/Users/student/Desktop/testApp/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:27:15)
at /Users/student/Desktop/testApp/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:200:4
at callback (/Users/student/Desktop/testApp/node_modules/graceful-fs/polyfills.js:299:20)
Executing webpack failed with exit code 1.
Thank you for reporting this, we have confirmed a breaking change in the latest webpack release:
https://github.com/webpack/webpack/releases/tag/v5.51.1
You can switch your package.json to use the rc as follows to resolve this right now:
"devDependencies": {
...
"#nativescript/webpack": "rc"
},
Then ns clean and you should be able to run your app now.
We also published another beta tag pinning webpack to 5.50.0 so doing ns clean without making any other dependency change in your own package.json should also work now.
ld: 6 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
Any idea what is the problem ?
can't build using xcode 10.2
ionic info
Ionic:
Ionic CLI : 5.0.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.1.10
Cordova:
Cordova CLI : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 26 other plugins)
Utility:
cordova-res : 0.5.2
native-run : not installed
System:
ios-deploy : 1.9.4
NodeJS : v8.12.0 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version 10E1001
cordova plugin list
call-number 0.0.2 "Cordova Call Number Plugin"
com-badrit-base64 0.2.0 "Base64"
cordova-open-native-settings 1.5.2 "Native settings"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-advanced-http 1.11.1 "Advanced HTTP plugin"
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-contacts 3.0.1 "Contacts"
cordova-plugin-decimal-keyboard 1.0.0 "Decimal Keyboard"
cordova-plugin-decimal-keyboard-wkwebview 1.0.3 "Decimal Keyboard"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.6.2 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-intercom 6.2.0 "Intercom"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-qrscanner 3.0.1 "QRScanner"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-uniquedeviceid 1.3.2 "UniqueDeviceID"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-x-socialsharing 5.4.7 "SocialSharing"
cordova-sms-plugin 0.1.13 "Cordova SMS Plugin"
cordova-sqlite-storage 2.6.0 "Cordova sqlite storage plugin"
es6-promise-plugin 4.2.2 "Promise"
phonegap-plugin-barcodescanner 8.1.0 "BarcodeScanner"
ld: 6 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/emulator/***************** normal x86_64
(1 failure)
CordovaError: Promise rejected with non-error: 'Error code 65 for command: xcodebuild with args: -***************** ... ******* ,-UseModernBuildSystem=0'
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
[ERROR] An error occurred while running subprocess cordova.
cordova build ios --verbose --buildFlag=-UseModernBuildSystem=0 exited with exit code 1.
The problem was conflict between 2 cordova-plugins.
cordova-plugin-decimal-keyboard-wkwebview
and
cordova-plugin-ionic-webview
I removed cordova-plugin-decimal-keyboard-wkwebview and it worked fine.
A thing that should also be noted and fixed the error message on my side, was to delete the relevant folder of the app inside the DerivedData Folder found in /Users/USERNAME/Library/Developer/DerivedData/
Was also mentioned on other similar error messages
For anyone facing this issue in 2022, my problem was with cordova-universal-links-plugin. Removing this plugin made the build succeed.
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.