2

My app was running fine and now it is showing me an error which i tried to figure out until now.

ERROR in ../node_modules/nativescript-permissions/permissions.js
Module not found: Error: Can't resolve '@master.technology/permissions' in '/Users/abdull/Desktop/my-app/node_modules/nativescript-permissions'
 @ ../node_modules/nativescript-permissions/permissions.js 13:17-58
 @ ../node_modules/@nativescript/imagepicker/index.js
 @ ./app/shared/image-helper.ts
 @ ./app/app.module.ts
 @ ./main.ts

After searching i figured out that i have a plugin "@nativescript/imagepicker": "^1.0.5" which requires "nativescript-permissions": "~1.3.0" in package-lock.json

Abdullah
  • 39
  • 5
  • I managed to fix this by going to the project directory and using `sudo su -- path`. The issue was not from project rather the permission level on mac. – Abdullah Nov 09 '21 at 07:05
  • Abdullah, I don't understand why changing the permission level on mac will solve this error. Can you explain me? – Alexis Nov 09 '21 at 09:01
  • @Alexis maybe there are other ways to fix it, but as i debug this error, `@nativescript/imagepicker"` has `required` for `nativescript-permissions` in `package-lock.json`. I tried installing that using `npm` but that wasn’t a solution. After debugging it further, i tried running it using `sudo` and it worked. I am still not sure why it was causing an error in the first place. – Abdullah Nov 09 '21 at 10:08
  • I also used `nvm` to change the version of node however using `sudo` fixed this error. – Abdullah Nov 09 '21 at 10:09
  • ok. Thanks you Abdullah. – Alexis Nov 09 '21 at 13:41
  • in complement: https://github.com/NathanaelA/nativescript-permissions/issues/49 – Alexis Nov 10 '21 at 07:18
  • @Alexis thanks for sharing. I have another project which is facing the same issue but its not getting resolved the way i mentioned above. After reading the link you shared, its true that the main issue is caused by `schematics` because thats the last thing i tried. Now trying to solve it the way its mentioned in links. – Abdullah Nov 10 '21 at 08:36
  • You're welcome .I hope, it will work for you. It did not work for us – Alexis Nov 10 '21 at 09:01
  • @Alexis i am figuring it out. Now i know for sure this error only occurred after using schematics. I am figuring a way out. Will comment once i find a solution. – Abdullah Nov 10 '21 at 09:08
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/239075/discussion-between-abdullah-and-alexis). – Abdullah Nov 10 '21 at 10:40
  • Easy solution is to update your project. That's how i fixed the error. – Abdullah Nov 10 '21 at 10:52
  • ok thanks @Abdullah. We will try it – Alexis Nov 10 '21 at 16:15

1 Answers1

1

Migrating from NativeScript 7 to NativeScript 8 fixed the issue for me. To migrate see the link https://v6.docs.nativescript.org/angular/releases/upgrade-instructions

$ tns migrate

After migration, when running the app it might say thar zone.js not found. For that the fix is available at: https://github.com/manfredsteyer/ngx-build-plus/issues/4 Add import 'zone.js' in main.ts

Vip3r
  • 13
  • 4