【发布时间】:2021-06-26 11:38:33
【问题描述】:
我在使用 Volta 管理不同版本节点的 Windows 机器上。
我在 2 个不同的文件夹中有 2 个不同的 ionic 应用程序,其中包含 2 个不同版本的 ionic。
在 1 个文件夹中,我可以运行 ionic serve 并且该应用程序在浏览器中提供。在这个文件夹中,这些是我的价值观。
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
这些是命令的 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
但在另一个文件夹中,我的 ionic 命令似乎找不到 ng。这就是我使用ionic serve时得到的结果
[ng] Volta error: Could not locate executable `ng` in your project.
这些是我的价值观:
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.
这里可能缺少什么?
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
阻止 ionic v4 查找 ng 可执行文件的问题可能是什么?
【问题讨论】:
-
考虑到这一点,所以第二个文件夹可能正在使用 node_modules 中的 ionic 和。该 ionic 命令无法获取 ng 可执行文件。听起来逻辑对吗?
标签: node.js angular ionic-framework npm volta