Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin installation fails to install file 'node_modules\nativescript-i18n\angular.ts' #33

Closed
ivoeersels opened this issue Jan 19, 2017 · 12 comments

Comments

@ivoeersels
Copy link

I followed the instructions and installed via command 'npm install --save nativescript-i18n'
But afterwards my builds would fail as NativeScript could not load the module 'nativescript-i18n/angular'.

C:\gitprojects\cb_poc_app>tns info
All NativeScript components versions information
┌────────────┬────────── ┬─────────┬────────┐
│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 2.4.2 │ 2.4.2 │ Up to date │
│ tns-core-modules │ 2.4.4 │ 2.4.4 │ Up to date │
│ tns-android │ 2.4.1 │ 2.4.1 │ Up to date │
│ tns-ios │ │ 2.4.0 │ Not installed │
└────────────┴──────────┴─────────┴─────────┘

I assume the support for Angular is quite new and maybe a mistake was made when submitting this plugin to NPM?
After I manually downloaded the file from 'https://github.com/rborn/nativescript-i18n/blob/master/angular.ts' (which matched my current version '0.0.9' of the plugin 'nativescript-i18n' all worked fine.

So please check your NPM module.

@rborn
Copy link
Collaborator

rborn commented Jan 23, 2017

@ivoeersels pushed to npm, could you have a look?
Thank you

@rborn rborn closed this as completed Jan 23, 2017
@ivoeersels
Copy link
Author

Looks like you fixed it @rborn
A powerful dev are you :-)

@ivoeersels
Copy link
Author

However, after switching to version 1.1 of nativescript-i18n plugin my project no longer builds.

Executing before-prepare hook from <MY_PROJECT_PATH>\hooks\before-prepar
e\nativescript-i18n.js
(node:36876) UnhandledPromiseRejectionWarning: Unhandled promise rejection (reje
ction id: 2): TypeError: Cannot read property 'stopExecution' of undefined

@rborn
Copy link
Collaborator

rborn commented Jan 24, 2017

Did you try to cleanup the project first and run a tns install ?

@rborn rborn reopened this Jan 24, 2017
@ivoeersels
Copy link
Author

I think so. I npm uninstalled this plugin, then made sure to update the version number in package.json to 0.1.1 and ran 'npm install' so the new version got installled. Did I miss something?

@rborn
Copy link
Collaborator

rborn commented Jan 24, 2017

Delete hooks, lib,node_modules, platforms from your project and run tns install
MAKE A BACKUP FIRST 😆

@zweimal
Copy link
Contributor

zweimal commented Jan 25, 2017

Delete hooks, lib,node_modules, platforms from your project and run tns install
MAKE A BACKUP FIRST 😆

Version is unusable. Installation went ok. I've already tried to remove all directories you said. Nothing changed. Here's the error thrown when I try to build the project:

(node:36876) UnhandledPromiseRejectionWarning: Unhandled promise rejection (reje
ction id: 2): TypeError: Cannot read property 'stopExecution' of undefined

I am back to version 0.0.9 (no version 0.1.0 8-|) and everything's alright again.

Off-topic: Could it return the key when the latter is no defined?

Thanks

@ivoeersels
Copy link
Author

I also rolled back to 0.0.9 as I need this to work now. Didn't try the directory cleanup mentioned by @rborn yet however.

@rborn
Copy link
Collaborator

rborn commented Jan 25, 2017

@ivoeersels @zweimal sorry guys, it should be fixed now.
Please clean the above folders first, install 0.1.2 and give it a shot.

If it's not working I might need a test project as the demo one in this repo seems to work fine.
Thanks again 😄

@ivoeersels
Copy link
Author

I did the same as before

  • npm uninstalled this plugin
  • updated the version number in package.json to 0.1.2
  • ran 'tns install' so the new version got installled

This time no errors anymore!

@rborn
Copy link
Collaborator

rborn commented Jan 25, 2017

@ivoeersels woohoo 😆
closing, thanks for the feedback 👍

@rborn rborn closed this as completed Jan 25, 2017
@zweimal
Copy link
Contributor

zweimal commented Jan 25, 2017

before-prepare hook worked!
Much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants