Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

找不到全局安装的命令 #11

Closed
devbean opened this issue May 16, 2024 · 4 comments
Closed

找不到全局安装的命令 #11

devbean opened this issue May 16, 2024 · 4 comments
Labels
invalid This doesn't seem right

Comments

@devbean
Copy link

devbean commented May 16, 2024

使用

vfox install nodejs
vfox use nodejs

后,全局安装 nodejs 依赖包:

npm install -g @angular/cli

使用ng --version会报错找不到命令。

使用npm config get prefix可以看到全局包被安装到了current目录。该目录应该加入环境变量,以便使用 npm 全局安装的命令。

@aooohan
Copy link
Member

aooohan commented May 16, 2024

image

没有报错呀

被安装到了current目录。该目录应该加入环境变量,

加入path了, 你配置Hook了吗?

https://vfox.lhan.me/zh-hans/guides/quick-start.html#_2-%E6%8C%82%E8%BD%BDvfox%E5%88%B0%E4%BD%A0%E7%9A%84shell

@devbean
Copy link
Author

devbean commented May 16, 2024

是说ng --version这个命令是报错的,您给出的截图也显示了红色的 Error。npm config get prefix返回的是ng命令被安装到了哪个目录。

@aooohan
Copy link
Member

aooohan commented May 16, 2024

ng新版本用 ng v。😓

image

@aooohan aooohan added the invalid This doesn't seem right label May 16, 2024
@devbean
Copy link
Author

devbean commented May 16, 2024


抱歉抱歉

@devbean devbean closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants