Groceries example of NativeScript tutorial - Failed "tns run ios" command


#1

Dear, Community of NativeScript!

I’m starting to learn NativeScript with NativeScript TypeScript and Angular getting started guide.

CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:344:22: Error: Uncaught (in promise): Error: Error in login/login.component.html:10:4 caused by: UIImage.tns_safeImageNamed is not a function. (In ‘UIImage.tns_safeImageNamed(name)’, ‘UIImage.tns_safeImageNamed’ is undefined)

Could you give me any advice please? I tried everything … I think.

Best regards,
David


#2

hi, I just downloaded the repo and it ran ok using tns run ios. So what I think may be the issue is an older installation of the CLI or the modules may be tripping you up. Please make sure you’ve upgraded NativeScript to the latest release by doing this: http://docs.nativescript.org/releases/upgrade-instructions and then remove the assets, hooks, node_modules and platforms folders and re-run tns run ios. You can also try tns run ios --clean to ensure everything is tidy. Let me know how it goes!


#3

Hi Jen!

You are awesome! :slight_smile: Finally it works! I don’t know what was the problem exactly but I reinstalled npm for the latest version and now it works! Now i use npm v. 6.9.5!

Thanks a lot! :kissing_heart:

Best regards,
David


#4

hooray! Glad it’s working! Now, go build something epic!