简体   繁体   中英

Unable to find ng command for ionic v4 but otherwise ok when using ionic v6

I am on a Windows machine using Volta to manage different versions of node.

I have 2 different ionic apps in 2 different folders with 2 different versions of ionic.

In 1 folder, I am able to run ionic serve and the app is served in the browser. In this folder, these are my values.

npm --version
6.14.11

node --version
v14.15.5

ionic --version
6.13.1

ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 11.2.6
Node: 14.15.5
OS: win32 x64

Angular: 11.2.7
... common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.6
@angular-devkit/build-angular   0.1102.6
@angular-devkit/core            11.2.6
@angular-devkit/schematics      11.2.6
@angular/cli                    11.2.6
@schematics/angular             11.2.6
@schematics/update              0.1102.6
rxjs                            6.6.7
typescript                      4.0.7

These are the gcm values for the commands:

gcm ionic

CommandType     Name             Version    Source
-----------     ----             -------    ------
Application     ionic.exe        0.0.0.0    C:\Users\user\AppData\Local\Volta\bin\ionic.exe

gcm npm

CommandType     Name             Version    Source
-----------     ----             -------    ------
Application     npm.exe        0.0.0.0    C:\Program Files\Volta\npm.exe

gcm node

CommandType     Name             Version    Source
-----------     ----             -------    ------
Application     node.exe        0.0.0.0    C:\Program Files\Volta\node.exe

gcm ng

CommandType     Name             Version    Source
-----------     ----             -------    ------
Application     ng.exe        0.0.0.0    C:\Users\user\AppData\Local\Volta\bin\ng.exe

But in the other folder, my ionic command can't seem to find ng . And this is what I get when I use ionic serve

[ng] Volta error: Could not locate executable `ng` in your project.

These are my values:

npm --version
6.14.11

node --version
v14.15.5

ionic --version
4.12.0

ng --version
Volta error: Could not locate executable `ng` in your project.

What might be missing here?

gcm ionic

CommandType     Name               Version    Source
-----------     ----               -------    ------
Application     ionic.exe          0.0.0.0    C:\Users\user\AppData\Local\Volta\bin\ionic.exe

gcm ng

CommandType     Name               Version    Source
-----------     ----               -------    ------
Application     ng.exe             0.0.0.0    C:\Users\user\AppData\Local\Volta\bin\ng.exe

What might be the issue here that is blocking the ionic v4 from finding the ng executable?

The issue was the project was on an exFAT disk. Moving the project to an NTFS disk and running install again works. The issue is no longer reproducible on an NTFS disk.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM