ionic-team / ionic-team/ionic-cli

CLI can't find global packages or npm. Maybe wrong path config?

未關閉
#4,599 8 則留言 0 個 reaction 已指派 0 人 已被 @sonntag-philipp 認領 在 GitHub 檢視
triage
主要語言
TypeScript
星號
2k
分支
682
PR 合併指標
30 天內沒有已合併 PR

描述

**Description:**
Hello there,
I'm currently trying to set up my dev environment on macOS Catalina 15.15.7. My problem is that the ionic cli
seems to ignore the paths of my angular cli.
Everytime I try to execute the `ionic serve` command, the cli wants me to install the angular cli because it can't find the ng command. When I try to install it it throws an exception as it can't find the `npm` command also.

**Steps to Reproduce:**
1. Install the latest version of nvm via the zsh on macOS
2. Install node version 14.15.0 (latest LTS)
3. Validate the node installation
4. Install @angular/cli via npm globally `npm install -g @angular/cli`
5. Validate @angular/cli using `ng --version` - Version 10.1.7
6. Install @ionic/cli via npm globally `npm install -g @ionic/cli`
7. Validate @ionic/cli using `ionic --version` - Version 6.12.1
8. Navigate to Ionic workspace root
9. Install all dependencies using `npm install -r`
10. Start Ionic/Angular dev server using `ionic serve --project=`
11. Ionic wants me to install the angular cli as it cannot find the `ng` command
12. When I try to install it, Ionic is also unable to find the `npm` command
13. ¯\\_(ツ)_/¯

**My `ionic info`:**
```
Ionic:

Ionic CLI : 6.12.1 (/Users/psn_local/.nvm/versions/node/v14.15.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.4.1 (/Users/psn_local/development/git/project-api/Clients/node_modules/@ionic/angular)
@angular-devkit/build-angular : 0.1001.7 (/Users/psn_local/development/git/project-api/Clients/node_modules/@angular-devkit/build-angular)
@angular-devkit/schematics : 10.1.7 (/Users/psn_local/development/git/project-api/Clients/node_modules/@angular-devkit/schematics)
@angular/cli : 10.1.7 (/Users/psn_local/development/git/project-api/Clients/node_modules/@angular/cli)
@ionic/angular-toolkit : 2.3.3 (/Users/psn_local/development/git/project-api/Clients/node_modules/@ionic/angular-toolkit)

Utility:

cordova-res : not installed
native-run : not installed

System:

NodeJS : v14.15.0 (/Users/psn_local/.nvm/versions/node/v14.15.0/bin/node)
npm : 6.14.8
OS : macOS Catalina
```

**Other Information:**
*Things I already tried*
1. Installation as another user
2. Installation of Node via the installer from the official website
3. Installation of Node via Homebrew
4. Installation of Node via nvm
5. Using of pnpm for global and local packages (with updated configs of ionic and ng)
6. Setting an alias for the ng command like [here](https://github.com/angular/angular-cli/issues/503#issuecomment-213455646)
7. Manually adding PATHS to the .zshrc file of the user

貢獻指南

開啟貢獻指南

研究方向

No files or tests are named. Start by reproducing the reported setup and running `ionic serve --project=`, then inspect linked pull request #4608 for the work already underway. Done means the CLI can find both the global `ng` command and `npm` in the described environments.

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

評估

技術堆疊
angular, macos, node.js, typescript
領域
cli, tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

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

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