Nativescript: Error while running from VS Code

Created on 19 Feb 2017  路  5Comments  路  Source: NativeScript/NativeScript

Hello,

I recently started getting a weird error when I try to run my app in VS Code:

WARNING]: WARNING: CocoaPods requires your terminal to be using UTF-8 encoding. [31;1mProcessing node_modules failed. Exception: Pod install command failed. Error output: Consider adding the following to ~/.profile: export LANG=en_US.UTF-8

[NSDebugAdapter] The tns command finished its execution with code 127.

Has anyone seen that? I see the suggested action message, but I have no idea where ./profile is?

I am using tns version 2.5.0 and VS Code on El Capitan. I asked the question in SO a few days ago, but have not received any answers. http://stackoverflow.com/questions/42275783/nativescript-ios-cocoa-pods-build-error

NOTE: After running pod setup, removing the node_modules folder, and running tns install I can at least run the app via the terminal, but I am still having issues with VS Code.

Thank you.

question

Most helpful comment

@NickIliev

Following the link you provided, I modified ~/.bash_profile adding export LANG=en_US.UTF-8 and now everything is working.

Thank you for your help.

All 5 comments

Hi @dpdragnev,
We have tested this behavior on our side, however, was unable to reproduce this issue on our side.
Regard to that, could you provide some more info about your environment (node and CocoaPods versions).

It would also help if you could give us the exact steps, you are using and info, whether this issue has been reproduced for iOS or Android.

In the meantime, you could upgrade your NativeScpirpt to version 2.5.1 by following the instructions here. and your CocoaPods with sudo gem install cocoapods

@dpdragnev

Type echo $LANG in your VSCode terminal and post the output It should be something like en_US.UTF-8.
Check also the default terminal you are using (outside of VSCode) - it should also print the same.

I guess your VSCode terminal is not respecting the ~/.profile as mentioned here and you might need to manually export your settings where needed (based on your OS and the terminal used).
Once you modify your profile file (e.g.. open ~/.bashrc and add the export statement for UTF) do not forget to close your terminal for the changes to take effect.

@tsonevn
Thank you for your suggestion. I upgraded my system and project, but I am still getting this when I run the app from VS Code:

[NativeScriptCli] execute: tns --version
[NSDebugAdapter] Using tns CLI v2.5.1 on path 'tns'
[NSDebugAdapter] Running tns command...
[NativeScriptCli] execute: tns debug ios --no-client --no-watch
[NSDebugAdapter] Watching the tns CLI output to receive a connection token
Preparing project...
Successfully prepared plugin nativescript-appversion for ios.
Successfully prepared plugin nativescript-drop-down for ios.
Successfully prepared plugin nativescript-intl for ios.
Successfully prepared plugin nativescript-iqkeyboardmanager for ios.
Successfully prepared plugin nativescript-loading-indicator for ios.
Successfully prepared plugin nativescript-phone for ios.
Successfully prepared plugin nativescript-statusbar for ios.
Successfully prepared plugin nativescript-telerik-ui for ios.
Successfully prepared plugin nativescript-toast for ios.
Successfully prepared plugin tns-core-modules for ios.
Successfully prepared plugin tns-core-modules-widgets for ios.
Installing pods...
Analyzing dependencies
Downloading dependencies
Using IQKeyboardManager (4.0.8)
Using MBProgressHUD (1.0.0)
Using Toaster (2.0.3)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 3 total pods installed.
[31;1mProcessing node_modules failed. Exception: Pod install command failed. Error output:
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8

[NSDebugAdapter] The tns command finished its execution with code 127.

@NickIliev
I get en_US.UTF-8 when I run echo $LANG from both, the terminal and VS Code. Very strange.

@NickIliev

Following the link you provided, I modified ~/.bash_profile adding export LANG=en_US.UTF-8 and now everything is working.

Thank you for your help.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pocesar picture pocesar  路  3Comments

Pourya8366 picture Pourya8366  路  3Comments

fmmsilva picture fmmsilva  路  3Comments

NickIliev picture NickIliev  路  3Comments

rLoka picture rLoka  路  3Comments