Could not find module 'nativescript-angular/platform'


My app was working (not very far removed from “hello world” at this point) and then the next day, without changing anything, I got this error when running tns run ios:

file:///app/main.js:4:25: JS ERROR Error: Could not find module 'nativescript-angular/platform'. Computed path '/Users/danbock/Library/Developer/CoreSimulator/Devices/C62BBFD7-E510-4A9C-898A-020DF30D9BD5/data/Containers/Bundle/Application/5F353360-3EFB-402B-938E-1E5660D8E2A6/'.

The app won’t launch. I tried cloning the git project in another directory, running npm install and tns run ios, and it worked. So I guess I have a workaround, but is there a better way to solve or prevent this?


That’s a hassle! The standard method to get rid of these issues is to delete /platforms, /hooks and /node_modules and do a tns run ios or tns run android. Hope this doesn’t happen again, but if so try that.


Thanks! That worked.