我正在尝试学习 NativeScript。我已完成以下步骤在我的 windows 8.1 Pro 64 位机器上安装 NativeScript:
- 在 D 盘上安装 node.js (node-v8.11.2-x64)
- 在 D 盘上安装 Visual Studio Code (VSCodeSetup-x64-1.23.1)
- 在 D 盘上安装 Git (Git-2.17.0-64-bit)
- 在 D 盘上安装 Android Studio (android-studio-ide-173.4720617-windows)
- 使用以下命令安装 NativeScript:npm install -g nativescript。
我在第 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
当我运行 tns doctor 命令时,我收到以下信息:
> 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)
我也尝试卸载 NativeScript,但它仍然卡在 resolveWithNewModule 上,见下文:
C:\Users\UserName>npm uninstall -g nativescript
[ ................] / loadDep:readdirp: sill resolveWithNewModule xcode@0.8.0 checking installable status
我的问题是:
- 如何修复 NativeScript 的安装错误?
- 如果我需要卸载 NativeScript,我该怎么做?
- 哪个目录 NativeScript 使用已安装的命令安装,我可以将它安装在 d 驱动器上吗?