NativeScript: [Critical issue][Challenge] Fatal bug on CLI command line

Below is the console log on Win 10; Please help investigate !

Microsoft Windows version 10.0.10586 2015 Microsoft Corporation. Tous droits réservés.

C:\Users\root>npm update -g

C:\Users\root>tns
Unexpected token
SyntaxError: Unexpected token
    at FiberFuture.Future.wait (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:535:15)
    at C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\lib\nativescript-cli.js:21:45
    - - - - -
    at Object.parse (native)
    at C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\lib\common\file-system.js:222:29
    at Function.settle (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
    at FiberFuture.Future.wait (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)
    at C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\user-settings-service.js:50:89
    at Function.settle (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
    at FiberFuture.Future.wait (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)
    at C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\user-settings-service.js:12:42
    at Function.settle (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
    at FiberFuture.Future.wait (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)
    at C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\analytics-service.js:124:92
    at Function.settle (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
    at FiberFuture.Future.wait (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)
    at C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\analytics-service.js:218:64
    at Function.settle (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
    at FiberFuture.Future.wait (C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 40 (15 by maintainers)

Most upvoted comments

On my Mac i get the same error, when i want to “livesync” my ios project. I’ve also test out the options described above, with no luck. The following is the output of the “CLI” with the command tns --log trace livesync ios --emulator --watch. For Android the command tns --log trace livesync android --emulator --watch works like a charm

Project successfully prepared
AfterHookName for command prepare is after-prepare
BeforeHookName for command livesync is before-livesync
Executing before-livesync hook from /Users/***/test/nativescriptplay/hooks/before-livesync/nativescript-angular-sync .js
Executing before-livesync hook at location /Users/***/test/nativescriptplay/hooks/before-livesync/nativescript-angular-sync .js in-process
Hook completed
Error: [object Object] is not a future
    at FiberFuture.Future.wait (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/fibers/future.js:535:15)
    at /Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/lib/common/errors.js:123:33
    at Function.settle (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/lib/common/services/commands-service.js:84:106
    at Function.settle (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/lib/common/dispatchers.js:38:85
    at Function.settle (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/lib/nativescript-cli.js:21:45
    - - - - -
    at getFutures (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/fibers/future.js:202:10)
    at Function.settle (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/fibers/future.js:214:16)
    at /Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:231:28
    at arrayMap (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/ios-sim-portable/node_modules/lodash/index.js:1378:25)
    at Function.map (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/ios-sim-portable/node_modules/lodash/index.js:6154:14)
    at /Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:228:29
    at Function.settle (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/ios-sim-portable/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/ios-sim-portable/node_modules/fibers/future.js:565:10)
    at /Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:257:55
    at Function.settle (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/ios-sim-portable/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/ios-sim-portable/node_modules/fibers/future.js:565:10)
    at /Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/lib/common/services/livesync-service-base.js:197:63
    at Function.settle (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/ios-sim-portable/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/ios-sim-portable/node_modules/fibers/future.js:565:10)
    at /Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/lib/common/services/livesync-service-base.js:38:45
    at Function.settle (/Users/***/node-v4.4.5-darwin-x64/lib/node_modules/nativescript/node_modules/ios-sim-portable/node_modules/fibers/future.js:249:26)

thank you for this amazing project. i’ve seen too late #2336

@meow0703 I really do appreciate that you want to use NativeScript and that this issue is blocking you and it is critical to get fixed for you so that you can use it! However, I’m going to re-iterate; this is a open source project. It is not considered to be good behavior to be demanding support in ANY open source project. If you want support you can demand, you need to get a support contract from Telerik/Progress or even pay a third party contractor (Like me) to be a support person you can contact at a moments notice and demand help. Otherwise; you need to realize that this being a open source project a large chunk of us helping are NOT being paid by anyone to help or answer questions, but are just volunteering our time (like me) because I want to give back to the project. None-the-less your issue is judged based on its merits against the other 200ish open issues on what things get fixed and in what priority they get fixed; demands won’t increase the priority, they just will annoy most of us.

I’m pretty sure this isn’t a NativeScript issue; but instead there is something wrong with your node environment. Hopefully, we will be able to fix it…

Can you attach the specific file: C:\Users\root\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js

Also please tell me the results of: npm config ls -l

@meow0703 NativeScript is a open source product. If you have a critical issue; your best bet is to get paid Telerik/Progress support contract of some sort. Otherwise the support you are receiving is provided for FREE by Telerik employees and other nativescript users (like me).

Github currently shows there are currently 193 open issues in this repo alone ( and there are several NS repos, one for each of the pieces of NS ), so your issue is just one of the many issues open. I know the Telerik employees are trying hard to cover all the issues; but it takes time to duplicate issues, then to fix them and finally just TEST them before they release. Each of those steps takes time. They also have to prioritize issues based on the effect a issue has on the whole eco-system. For all the free support that Telerik/Progress team does provide, they do a awesome job.

So please keep the demands out of any requests for free support!

Now as to your issue – I might have a solution if your willing to try it. Based on your issue; I have seen something like it before; and the simplest solution is actually to use a earlier version of node. I personally do know 4.3.1 works on Windows with NativeScript.

  1. Downgrade your Node to v4.3.1 – You can download the older version from https://nodejs.org/download/release/v4.3.1/
  2. NPM version actually doesn’t really matter, afaik – but there is a possibility npm 3.9.x has issues; so it is typically safer to stick with the version that comes with node.
  3. After you have installed node; double check it is node 4.3.1 by doing a node --version
  4. Next type npm cache clean
  5. Then try and do a npm remove -g nativescript
  6. Then try and do a npm remove -g nativescript (Yes, do this twice!)
  7. Then try and do a npm install -g nativescript
  8. Then just to test; type nativescript doctor

Please note; the second un-install may totally fail as it did properly uninstall the first time. This is not a issue if it fails the second time when it appears to have worked the first time; the idea is to force it to uninstall everything. I have seen the first time fail to fully uninistall even though it looks like it worked. There is a issue with the pre-uninistall script in NativeScript that sometimes fails to allow NPM to fully uninstall nativescript.