Nativescript-angular: "application entry point file not found Please specify in package.json"

Created on 26 Jan 2017  路  8Comments  路  Source: NativeScript/nativescript-angular

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.nIf using typescript make sure your entry point file is transpiled to javascript.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5406)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.nIf using typescript make sure your entry point file is transpiled to javascript.
at com.tns.Module.bootstrapApp(Module.java:337)
at com.tns.Runtime.run(Runtime.java:508)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
... 8 more
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
at com.tns.Module.resolvePathHelper(Module.java:159)
at com.tns.Module.bootstrapApp(Module.java:335)
... 12 more

Most helpful comment

got the same error
for me this solves problem - nativescript.config.ts

export default {
  id: 'org.nativescript.blank',
  appResourcesPath: 'App_Resources',
  android: {
    v8Flags: '--expose_gc',
    markingMode: 'none'
  },
  appPath: 'src',
} as NativeScriptConfig;

All 8 comments

@tjvantoll Please help dude on above error

@bharathnallamothu Hey, sorry you ran into issues here :( This usually happens when your app/package.json鈥檚 "main" points at a file that doesn鈥檛 exist.

As an example note how https://github.com/NativeScript/sample-Groceries/blob/282be7967aa6572100decad2c05289cfd6a3b729/app/package.json#L2 points at https://github.com/NativeScript/sample-Groceries/blob/282be7967aa6572100decad2c05289cfd6a3b729/app/main.ts.

If that doesn鈥檛 help you you follow up in our community forum? (This issue tracker is for bugs in the nativescript-angular package.)

Best of luck.

i got solution for above problem @tjvantoll we have upgrade our node verion to latest (v6.9.4 LTS)
https://nodejs.org/dist/v6.9.4/node-v6.9.4-x64.msi

get the latest version from above link and install it. set Path in environment variable

Hi,
After create a new project like below:
ng new -c=@nativescript/schematics sass-project --shared --style=scss

i got the same error when i run
tns preview

Angular CLI: 7.3.0
Node: 10.14.1
OS: win32 x64

@dudipsh I had the same issue until I found this
https://github.com/NativeScript/nativescript-angular/issues/1640

I ran into same issue by using:
tns priview

solved the problem using:
tns preview --bundle

Uninstall previous versions

got the same error
for me this solves problem - nativescript.config.ts

export default {
  id: 'org.nativescript.blank',
  appResourcesPath: 'App_Resources',
  android: {
    v8Flags: '--expose_gc',
    markingMode: 'none'
  },
  appPath: 'src',
} as NativeScriptConfig;
Was this page helpful?
0 / 5 - 0 ratings