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

Error at running cli after install #498

Closed
enchev opened this issue May 26, 2015 · 8 comments
Closed

Error at running cli after install #498

enchev opened this issue May 26, 2015 · 8 comments
Assignees
Labels
Milestone

Comments

@enchev
Copy link
Contributor

enchev commented May 26, 2015

From @elidiazgt on May 23, 2015 16:31

$ nativescript --help
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at Function.Object.defineProperty.get [as killSwitchDir](/usr/lib/node_modules/nativescript/lib/com
mon/services/cancellation.js:55:25)
at new CancellationService (/usr/lib/node_modules/nativescript/lib/common/services/cancellation.js:1
3:53)
at Yok.resolveConstructor (/usr/lib/node_modules/nativescript/lib/common/yok.js:289:18)
at Yok.resolveByName (/usr/lib/node_modules/nativescript/lib/common/yok.js:315:44)
at Yok.resolve (/usr/lib/node_modules/nativescript/lib/common/yok.js:247:25)
at /usr/lib/node_modules/nativescript/lib/common/yok.js:280:30
at Array.map (native)

Copied from original issue: NativeScript/NativeScript#208

@enchev
Copy link
Contributor Author

enchev commented May 26, 2015

From @NathanaelA on May 23, 2015 17:25

Looking at the source it is looking for one of these environmental variables:
process.env.SUDO_USER or process.env.USER or process.env.USERNAME

What unix variant are you running that one of those isn't defined? Can you run a output your exports and see what variable actually has your user name in it?

@enchev
Copy link
Contributor Author

enchev commented May 26, 2015

From @teobugslayer on May 25, 2015 9:53

Hi @elidiazgt,

can you run nativescript --help --log trace > log.txt and post the contents of log.txt?

@enchev
Copy link
Contributor Author

enchev commented May 26, 2015

From @elidiazgt on May 26, 2015 1:11

Hello @teobugslayer
This is the log.txt content

TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at Function.Object.defineProperty.get '[as killSwitchDir]' (/usr/lib/node_modules/nativescript/lib/com
mon/services/cancellation.js:55:25)
at new CancellationService (/usr/lib/node_modules/nativescript/lib/common/services/cancellation.js:1
3:53)
at Yok.resolveConstructor (/usr/lib/node_modules/nativescript/lib/common/yok.js:289:18)
at Yok.resolveByName (/usr/lib/node_modules/nativescript/lib/common/yok.js:315:44)
at Yok.resolve (/usr/lib/node_modules/nativescript/lib/common/yok.js:247:25)
at /usr/lib/node_modules/nativescript/lib/common/yok.js:280:30
at Array.map (native)

@enchev
Copy link
Contributor Author

enchev commented May 26, 2015

From @elidiazgt on May 26, 2015 1:12

hello @NathanaelA am using a docker container, if i run this commands
echo $USER
echo $SUDO_USER
echo $USERNAME
the result is empty, i need to set those variables? can i mantain my virgen docker?

@enchev
Copy link
Contributor Author

enchev commented May 26, 2015

From @NathanaelA on May 26, 2015 3:20

@teobugslayer -- the issue is a missing environmental variable -- their are a couple places in the TNS/NativeScript cli & several gruntfiles where Telerik is assuming a environmental variable is set and it will crash if they are not. This is one of those cases...

@elidiazgt - you can either before you run TNS/NativeScript, do a export USER="" where is the user in the container so that the TNS command can create the lock directory. Another choice would be to type "set | grep -i " again where is what user that is running inside the docker container and see which environmental variable IS set to have the user name. Then I (or someone at Telerik) can commit a quick change that will add that environmental variable to the list of valid variables to pull the environment from. A third possibility would be for you to do a quick export USER= once before you run the TNS command so that user is set.

@enchev
Copy link
Contributor Author

enchev commented May 26, 2015

From @NathanaelA on May 26, 2015 5:14

@teobugslayer -- since you actually appear to be one of the Telerik devs on CLI; the issue is the "cancellation.ts" file inside the mobile-cli-lib project. https://github.com/telerik/mobile-cli-lib/blob/master/services/cancellation.ts#L61 -- I'll did a pull request telerik/mobile-cli-lib#345 to fix this.

@teobugslayer
Copy link
Contributor

Hello @NathanaelA,

indeed, CancellationService is a code which is needed on Windows to ensure that files are cleanly overwritten on update and uninstall. We decided to stop using it on Linux & Mac. The relevant commits are in the master branch: telerik/mobile-cli-lib@d1230fa and telerik/mobile-cli-lib@61b2d77 .

The fixes will be in our next public release. In the mean time, the hack with exporting USER should work with the caveat that it must also be done when removing the NativeScript CLI.

@teobugslayer teobugslayer added this to the 1.0.2 milestone May 27, 2015
@teobugslayer teobugslayer self-assigned this May 27, 2015
@teobugslayer
Copy link
Contributor

@elidiazgt, @NathanaelA,

We have released {N} CLI 1.0.2 which addresses this issue. Give it a try and check if it works for you. Thank you for your help!

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

No branches or pull requests

3 participants