简体   繁体   English

无法找到 ionic v4 的 ng 命令,但在使用 ionic v6 时可以

[英]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.我在使用 Volta 管理不同版本节点的 Windows 机器上。

I have 2 different ionic apps in 2 different folders with 2 different versions of ionic.我在 2 个不同的文件夹中有 2 个不同的 ionic 应用程序,有 2 个不同版本的 ionic。

In 1 folder, I am able to run ionic serve and the app is served in the browser.在 1 个文件夹中,我能够运行ionic serve并且该应用程序在浏览器中提供。 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 值:

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 .但是在另一个文件夹中,我的 ionic 命令似乎找不到ng And this is what I get when I use ionic serve这就是我使用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?阻止 ionic v4 查找 ng 可执行文件的问题可能是什么?

The issue was the project was on an exFAT disk.问题是该项目位于 exFAT 磁盘上。 Moving the project to an NTFS disk and running install again works.将项目移动到 NTFS 磁盘并再次运行安装即可。 The issue is no longer reproducible on an NTFS disk.该问题不再在 NTFS 磁盘上重现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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