NativeScript / NativeScript/nativescript-cli

Unable to Update CLI

未關閉
#5,045 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

docs
主要語言
JavaScript
星號
1.1k
分支
204
平均合併
1 天 9 小時
30 天內合併 PR
8

描述

Environment

  • CLI: 5.1.0
  • OS: macOS Mojave version 10.14.4

Describe the bug
I am attempting to update the CLI to 6.1.2 however am having some issues during the upgrade process. I follow the upgrade instructions in the documentation by running 'npm install -g nativescript' which then prints out the following:

> nativescript@5.1.1 preuninstall /Users/myuser/.npm-global/lib/node_modules/nativescript
> node preuninstall.js

/Users/myuser/.npm-global/bin/nativescript -> /Users/myuser/.npm-global/lib/node_modules/nativescript/bin/tns
/Users/myuser/.npm-global/bin/tns -> /Users/myuser/.npm-global/lib/node_modules/nativescript/bin/tns

> fsevents@1.2.9 install /Users/myuser/.npm-global/lib/node_modules/nativescript/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download 
[fsevents] Success: "/Users/myuser/.npm-global/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote

> nativescript@6.1.2 postinstall /Users/myuser/.npm-global/lib/node_modules/nativescript
> node postinstall.js

Autocompletion is already enabled

You have successfully installed the NativeScript CLI!

Your next step is to create a new project:
tns create

New to NativeScript? Try the tutorials in NativeScript Playground: https://play.nativescript.org


If you have any questions, check Stack Overflow: https://stackoverflow.com/questions/tagged/nativescript and our public Slack channel: https://nativescriptcommunity.slack.com/

+ nativescript@6.1.2
added 124 packages from 115 contributors, removed 51 packages and updated 178 packages in 11.277s

However when checking the version using 'tns --version' it still shows 5.1.0.

I have attempted to completely uninstall the CLI and to confirm I check that it is completely uninstalled by attempting to run a tns command, as well as checking 'which tns' - both of which seems to show it is completely deleted. However, reinstalling nativescript always leads it back to 5.1.0.

Running the command 'which tns' results in the following path:

/usr/local/bin/tns

At this point I am stuck as to what to do to fix this, however my belief is that the issue lies in the path above not being equal to the path showed during the install process of /.npm-global/lib/node_modules/nativescript. Any help would be greatly appreciated.

Thank you!

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,比對 which tns 回報的可執行檔與 .npm-global/lib/node_modules/nativescript 下的安裝路徑,然後在執行文件中所述的 npm install -g nativescript 指令後執行 tns --version。當目前使用的 tns 可執行檔回報的版本為 6.1.2 而非 5.1.0 時,即表示完成;該 issue 未指定原始檔或測試。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, node.js
領域
cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。