Skip to content

[TIP] [SOLVED] Nativescript Zip error on tns run ios and android #34

@razorsyntax

Description

@razorsyntax

When I run tns run ios I get the following message and the app terminates:

ERROR in ../node_modules/nativescript-app-sync/TNSLocalPackage.js
Module not found: Error: Can't resolve 'nativescript-zip' in '/{homefolder}/{App}/{App-Name}/node_modules/nativescript-app-sync'
 @ ../node_modules/nativescript-app-sync/TNSLocalPackage.js 3:25-52
 @ ../node_modules/nativescript-app-sync/app-sync.js
 @ ./main.ts

The following is the stacktrace:

***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x10bffe91f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x10c044d1f -[TNSRuntime executeModule:referredBy:]
3   0x10b845be3 main
4   0x10ffce541 start
JavaScript stack trace:
1   ../node_modules/properties/lib/stringify.js@file:///node_modules/properties/lib/stringify.js:9:17
2   __webpack_require__@file:///app/webpack/bootstrap:750:0
3   fn@file:///app/webpack/bootstrap:120:0
4   ../node_modules/properties/lib/write.js@file:///node_modules/properties/lib/write.js:4:23
5   __webpack_require__@file:///app/webpack/bootstrap:750:0
6   fn@file:///app/webpack/bootstrap:120:0
7   ../node_modules/properties/lib/index.js@file:///node_modules/properties/lib/index.js:7:19
8   __webpack_require__@file:///app/webpack/bootstrap:750:0
9   fn@file:///app/webpack/bootstrap:120:0
10  @file:///node_modules/tns-core-modules/ui/core/bindable/bindable.js:2:27
11  ../node_modules/tns-core-modules/ui/core/bindable/bindable.js@file:///app/vendor.js:176900:34
12  __webpack_require__@file:///app/webpack/bootstrap:750:0
13  fn@file:///app/webpack/bootstrap:120:0
14  @file:///node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js:2:25
15  ../node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js@file:///app/vendor.js:176000:34
16  __webpack_require__@file:///app/webpack/bootstrap:750:0
17  fn@file:///app/webpack/bootstrap:120:0
18  @file:///node_modules/tns-core-modules/ui/builder/builder.js:5:34
<…>
JavaScript error:
file:///node_modules/properties/lib/stringify.js:9:17 JS ERROR TypeError: undefined is not an object (evaluating 'global.process.platform')
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: undefined is not an object (evaluating 'global.process.platform')
at
1   ../node_modules/properties/lib/stringify.js@file:///node_modules/properties/lib/stringify.js:9:17
2   __webpack_require__@file:///app/webpack/bootstrap:750:0
3   fn@file:///app/webpack/bootstrap:120:0
4   ../node_modules/properties/lib/write.js@file:///node_modules/properties/lib/write.js:4:23
5   __webpack_require__@file:///app/webpack/bootstrap:750:0
6   fn@file:///app/webpack/bootstrap:120:0
7   ../node_modules/properties/lib/index.js@file:///node_modules/properties/lib/index.js:7:19
8   __webpack_require__@file:///app/webpack/bootstrap:750:0
9   fn@file:///app/webpack/bootstrap:120:0
10  @file:///node_modules/tns-core-modules/ui/core/bindable/bindable.js:2:27
11  ../node_modules/tns-core-modules/ui/core/bindable/bindable.js@file:///app/vendor.js:176900:34
12  __webpack_require__@file:///app/webpack/bootstrap:750:0
13  fn@file:///app/webpack/bootstrap:120:0
14  @file:///node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js:2:25
15  ../node_modules/tns-core-modules/ui/builder/component-builder/component-bu<…>
NativeScript caught signal 6.
Native Stack:
1   0x10c04384f sig_handler(int)
2   0x11032db5d _sigtramp
3   0xffff00001fa5
4   0x1100b001d abort
5   0x10fe499d1 __cxa_bad_cast
6   0x10fe49b6f default_unexpected_handler()
7   0x10efbbe2d _objc_terminate()
8   0x10fe55a2e std::__terminate(void (*)())
9   0x10fe554eb __cxa_get_exception_ptr
10  0x10fe554b2 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*)
11  0x10efbbbfa _objc_exception_destructor(void*)
12  0x10bffed58 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
13  0x10c044d1f -[TNSRuntime executeModule:referredBy:]
14  0x10b845be3 main
15  0x10ffce541 start
JS Stack:
Successfully synced application com.nativescript.{appname} on device 6A1095F3-58DF-4F18-9B22-C284166E3E55.
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x106a8e91f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x106ad4d1f -[TNSRuntime executeModule:referredBy:]
3   0x1062d5be3 main
4   0x10a98e541 start
JavaScript stack trace:
1   ../node_modules/properties/lib/stringify.js@file:///node_modules/properties/lib/stringify.js:9:17
2   __webpack_require__@file:///app/webpack/bootstrap:750:0
3   fn@file:///app/webpack/bootstrap:120:0
4   ../node_modules/properties/lib/write.js@file:///node_modules/properties/lib/write.js:4:23
5   __webpack_require__@file:///app/webpack/bootstrap:750:0
6   fn@file:///app/webpack/bootstrap:120:0
7   ../node_modules/properties/lib/index.js@file:///node_modules/properties/lib/index.js:7:19
8   __webpack_require__@file:///app/webpack/bootstrap:750:0
9   fn@file:///app/webpack/bootstrap:120:0
10  @file:///node_modules/tns-core-modules/ui/core/bindable/bindable.js:2:27
11  ../node_modules/tns-core-modules/ui/core/bindable/bindable.js@file:///app/vendor.js:176900:34
12  __webpack_require__@file:///app/webpack/bootstrap:750:0
13  fn@file:///app/webpack/bootstrap:120:0
14  @file:///node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js:2:25
15  ../node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js@file:///app/vendor.js:176000:34
16  __webpack_require__@file:///app/webpack/bootstrap:750:0
17  fn@file:///app/webpack/bootstrap:120:0
18  @file:///node_modules/tns-core-modules/ui/builder/builder.js:5:34
<…>
JavaScript error:
file:///node_modules/properties/lib/stringify.js:9:17 JS ERROR TypeError: undefined is not an object (evaluating 'global.process.platform')
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: undefined is not an object (evaluating 'global.process.platform')
at
1   ../node_modules/properties/lib/stringify.js@file:///node_modules/properties/lib/stringify.js:9:17
2   __webpack_require__@file:///app/webpack/bootstrap:750:0
3   fn@file:///app/webpack/bootstrap:120:0
4   ../node_modules/properties/lib/write.js@file:///node_modules/properties/lib/write.js:4:23
5   __webpack_require__@file:///app/webpack/bootstrap:750:0
6   fn@file:///app/webpack/bootstrap:120:0
7   ../node_modules/properties/lib/index.js@file:///node_modules/properties/lib/index.js:7:19
8   __webpack_require__@file:///app/webpack/bootstrap:750:0
9   fn@file:///app/webpack/bootstrap:120:0
10  @file:///node_modules/tns-core-modules/ui/core/bindable/bindable.js:2:27
11  ../node_modules/tns-core-modules/ui/core/bindable/bindable.js@file:///app/vendor.js:176900:34
12  __webpack_require__@file:///app/webpack/bootstrap:750:0
13  fn@file:///app/webpack/bootstrap:120:0
14  @file:///node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js:2:25
15  ../node_modules/tns-core-modules/ui/builder/component-builder/component-bu<…>
NativeScript caught signal 6.
Native Stack:
1   0x106ad384f sig_handler(int)
2   0x10acf2b5d _sigtramp
3   0xffff
4   0x10aa7501d abort
5   0x10a8099d1 __cxa_bad_cast
6   0x10a809b6f default_unexpected_handler()
7   0x10997be2d _objc_terminate()
8   0x10a815a2e std::__terminate(void (*)())
9   0x10a8154eb __cxa_get_exception_ptr
10  0x10a8154b2 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*)
11  0x10997bbfa _objc_exception_destructor(void*)
12  0x106a8ed58 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
13  0x106ad4d1f -[TNSRuntime executeModule:referredBy:]
14  0x1062d5be3 main
15  0x10a98e541 start
JS Stack:

In main.ts:

import { platformNativeScriptDynamic } from 'nativescript-angular/platform';
import { AppModule } from './app.module';
import { isIOS } from "tns-core-modules/platform";

import * as application from "tns-core-modules/application";
import { AppSync, InstallMode/*, SyncStatus*/ } from 'nativescript-app-sync';

platformNativeScriptDynamic().bootstrapModule(AppModule);

application.on(application.resumeEvent, () => {
  AppSync.sync({
        deploymentKey: isIOS ? 'key1' : 'key2',
        installMode: InstallMode.ON_NEXT_RESTART, // default InstallMode.ON_NEXT_RESTART
        mandatoryInstallMode: isIOS ? InstallMode.ON_NEXT_RESUME : InstallMode.IMMEDIATE, // default InstallMode.ON_NEXT_RESUME
        updateDialog: { // only used for InstallMode.IMMEDIATE
          optionalUpdateMessage: "Updates Available.",
          updateTitle: "Please restart the app",
          mandatoryUpdateMessage: "This app needs to be updated.  Please restart the app.",
          optionalIgnoreButtonLabel: "Later",
          mandatoryContinueButtonLabel: isIOS ? "Exit now" : "Restart now",
          appendReleaseDescription: true // appends the description you (optionally) provided when releasing a new version to AppSync
        }
      });
  });

Any ideas? This also happens with Android, although with a different stacktrace but similar errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions