-
Notifications
You must be signed in to change notification settings - Fork 12
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
ng command not recognized in eclipse preference #107
Comments
I'm not sure, but I think this preference is not used with Angular Eclipse 1.3.0 since you can install ng cli in your wizard when you create a cli project. Hav you tried to create an new project with the wizard? @Springrbua could you see if Javascript->Typescript->Angular-CLI option is used? If not perhaps we should update the wizard? |
Let me give more background, I created this project using v1.2.0 and on a windows 7 os. Now, I am hust trying to use the same projecton a mac and I setup the ltes v1.3.0 of the plugin. I was not aware that this preference was not used anymore. So why is it there in the first place? If it is not used then how does the terminal recognizes the ng command? To further note, this is a company issued mac so I do not have admin privileges (going back to my previous issue where I highlighted the same problem for which the execute ng with file option was added by you), as a result of which I am not able to install ng globally as well. So, I am not trying to create a new project, I am trying to access an existing project and just trying to run it after setting it up. |
@angelozerr The preferences are still in use. Actually the new wizard also just updates this preferences with the options you set. @sayantansinha The field where you enter the ng location should already provide a default option, if you click on the little arrow on the left. This default option uses the $Project variable and links to the project specific ng installation. EDIT: |
@Springrbua yes I tried that as well and it does not work on either of the platforms (windows or mac) for me. The preferences page shows an error on the top and does not allow me to got another preference popping a message saying this page has invalid options set. |
Finally it worked, I followed @Springrbua suggestion:
I just turned on the project specific settings wherein the default worked
Also, had to make sure to delete any existing run configurations for the same project as changing the preferences and then running with the same run configuration did not pick up the latest preference (@Springrbua - shouldn't this be something that need to be fixed?) Hope this might be helpful for someone in the future. |
Thanks for the feedback! I have to take a look at the problem with the run configurations, I never had this bug but I'll try to reproduce it. |
@Springrbua I'm very busy for the moment with Codelens, if you have time please try it and give me feedback, thanks! |
@angelozerr I'll take a look at it as soon as possible |
If I remember I had done that, to configure ng path for the whole project of the workspace (it's a kind of ng global installation). But if it's confusing, perhaps we should remove this preferences since now ng new project wizard gives the capability to use ng global installed angular-cli or a given angular-cli to install?
Thanks! |
So you would remove the global settings? Or should I just add a "use global settings" option to the wizard and validate it only there? |
Yes it was my idea, but if it's more complex to understand, perhaps we should remove this preferences, I don't know. |
I guess we should keep the global preferences, because one could use a "global" cli-installation which is installed in some custom folder. This is currently not possible with the Wizard, since it lets you only choose global installation (installed with |
Exactly, it was my idea.
Yes it's the problem. We should add it in the wizard or remove it from General / Preferences.
Thanks! |
Adding my 2 cents, I never use the global settings as my project specific angular-cli installation is what I prefer to use as that is what is going to be used for my eventual building of the final artifacts. Additionally, I think you guys also need to look into the fact that why the existing run configurations doesn't get updated with the latest changes I do to the preferences wizard. It always refers to the old one and you have to delete and reconfigure the run settings again to allow it to pick up the latest preferences. |
@sayantansinha Yea of course, I'll also take a look at that. I'll try to reproduce the issue and I'll probably open a new Issue for it. |
@angelozerr My idea is to remove "use global CLI" and add "use global preferences" instead. |
Yes it's a good idea. |
@nitinkaveriappa Try setting it through project preferences and check. I got it working by changing it on the project preference. |
Perhaps it's again a bug with new Angular CLI version. Which version of Angular CLI are you using @nitinkaveriappa ? |
@sayantansinha I am not able to create an Angular Project, nor am I able to change it in the Preference |
Are you sure it's the version Angular CLI. I think you are using last version of Angular CLI (1.5?) I think you are using angular-eclipse 1.30, please install 1.4.0-SNAPSHOT with update site. |
@angelozerr Sorry my mistake. Angular CLI version I am using is 1.7.0 |
Ok thanks, I think 1.7.0 have changed their "ng -version". I will see that when I will find time. |
@angelozerr is there any solution for @nitinkaveriappa problem yet? |
I must just find time to study and fix the problem. But any contribution are welcome! |
Dear @angelozerr, shouldn't you take the plugin from the Eclipse Marketplace as long as this issue is not fixed? As far as I can see it, this issue has severity BROKEN und there is no workaround for Windows systems to fix it on the user side, or is there? Selecting a custom installation of cli with a valid path to ng doesn't change anything to the error. Preferences dialog keeps saying ".../ng.cmd is not a ng file" regardless of which path is selected. Project specific settings can not be activated as long as this error persists ("The currently displayed page contains invalid values"). I am using the latest release from the marketplace, 1.3.0, CLI version is 6.0.8. Lower CLI versions force the same error. |
Could you try to use "install cli"? Maybe this could work. |
@Springrbua I've tried that several times with different versions of CLI. Didn't work. It creates a project with just the node_modules folder in it. No src and e2e folders, no angular.json, package.json, tsconfig.json... My point is not to blame you for your limited time. I think, many people could safe a lot of nerves and time if it was taken down from the marketplace as long as this is neither fixed nor a reasonable workaround is provided. |
is it working with snapshot update site? If yes, I think we should to create a new release. |
What is the snapshot update site and where can I find it? My Eclipse is currently broken by this error, because I can't close the Angular CLI preferences page anymore ("The currently displayed page contains invalid values"). |
https://github.com/angelozerr/angular-eclipse/wiki/Installation-Update-Site |
Thanks a lot. I had tried .../1.4.0/ and .../1.4.0-SNAPSHOT/ I will give feedback here. |
The problem persists. I have checked the output of ng --version. That's kind of strange with ASCII art. I don't know, whether there is a variant of the --version option without ascii art. You won't be able to fix this as long as they keep playing around with crap like that in their version output. You might want to consider a boolean option (checkbox) in the preferences / the new project dialog to skip CLI validation. Or something like: "use ng.cmd anyway, I know, what I'm doing." This might help most people with a standard installation of angular cli. |
Thanks for your feedback @trhsrw . I agree with you, this version search must perhaps be less restrictive. I must find time to study this problem and do something. |
I found a solution to "The 'ng' is not a ng file." problem. You have to have ng set in your $PATH before starting Eclipse IDE. After that you should be able to create new Angular projects with angelo's plugin, since the plugin should find ng from $PATH (global _preferences). So this 'bug' seems to be more related to configuration.. Maybe this 'Global preference' should be editable so plugin would use users configuration instead of $PATH (if it is not found from $PATH) I hope this helps.. it solved my case of "The 'ng' is not a ng file." I'm using: |
PATH="$PATH:/usr/lib/node_modules//bin" --> PATH="$PATH:/usr/lib/node_modules/@angular/cli/bin" |
ah.. special character which is parsed away from text.. well anyways.. set Angular path in there. |
@JJN2 If you select |
Angular was installed globally with -g flag (as instructed in Angular web pages). It was globally usable since ng commands could be run from any folder location but $PATH settings were never modified by npm install -g ... |
Problem is that the embedded nodejs is used inside the $PATH. |
I'm having the same problem 1 year later. I've configured ng global I've also configured to use "installed" node.js 10.16.3 in directory C:\Program Files\nodejs with same results. Is there a fix/work around for windows 10? |
@garymazz: I ended up using the Eclipse WildWebDeveloper plugin (strongly recommended anyway) and the Angular CLI in Eclipse‘s terminal view. Works best for my purposes. |
After I add my angular-cli path on the Javascript->Typescript->Angular-CLI option under Eclipse Preference I get an error saying "The '/node_modules//bin/ng' is not a ng file". I am currently using macOS Sierra (v10.12.6) and using the same ng --version command provides the correct output listing down the version. I got this ng file after running npm install on my project's package.json which is referring to v1.0.2
Any help would be really appreciated.
The text was updated successfully, but these errors were encountered: