NativeScript CLI installation Error

I am trying to learn NativeScript. I have done following steps to install NativeScript on my windows 8.1 Pro 64 bit machine:

  1. Installed node.js (node-v8.11.2-x64) on D drive
  2. Installed Visual Studio Code (VSCodeSetup-x64-1.23.1) on D drive
  3. Installed Git (Git-2.17.0-64-bit) on D drive
  4. Installed Android Studio (android-studio-ide-173.4720617-windows) on D drive
  5. Installed NativeScript by using following command: npm install -g nativescript.

I receive following error on step 5:

C:\Users\UserName>npm install -g nativescript
nativescript@4.0.1 preuninstall C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript

node preuninstall.js

Failed to complete all pre-uninstall steps.

C:\Users\UserName\AppData\Roaming\npm\tns -> C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\bin\tns

C:\Users\UserName\AppData\Roaming\npm\nativescript -> C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\bin\tns

> nativescript@4.0.1 postinstall C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript

> node postinstall.js

RangeError: Maximum call stack size exceeded

at normalizeStringWin32 (path.js:33:30)

at Object.resolve (path.js:328:20)

at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:68:14)

at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:77:24)

at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)

at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)

at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)

at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)

at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)

at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules\nativescript\node_modules\fsevents):

    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ nativescript@4.0.1

updated 1 package in 18.244s

When I run tns doctor command I receive following information:

> C:\Users\UserName>tns doctor
> 
> RangeError: Maximum call stack size exceeded
> 
>     at normalizeStringWin32 (path.js:33:30)
> 
>     at Object.resolve (path.js:328:20)
> 
>     at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:68:14)
> 
>     at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:77:24)
> 
>     at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)
> 
>     at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)
> 
>     at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)
> 
>     at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)
> 
>     at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)
> 
>     at sync (C:\Users\UserName\AppData\Roaming\npm\node_modules\nativescript\node_modules\mkdirp\index.js:78:17)

I also tried to uninstall NativeScript but it gets stuck on still resolveWithNewModule, see below:

C:\Users\UserName>npm uninstall -g  nativescript

[  ................] / loadDep:readdirp: sill resolveWithNewModule xcode@0.8.0 checking installable status

My questions are:

  1. How to fix installation error for NativeScript?
  2. If I need to uninstall NativeScript, how can I do that?
  3. Which directory NativeScript gets installed with the installed command and can I install it on d drive?

1 Answer

  1. Jacob- Reply

    2019-11-13

    It looks like the installation process is running out of memory. Try running this command before running the installation:

    node --max-old-space-size=8192
    

    Set the last number according to RAM installed on your machine (2048, 4096 ecc)

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>