Code Monkey home page Code Monkey logo

Comments (16)

angelozerr avatar angelozerr commented on June 12, 2024

Previously, the output was redirected to Eclipse Console and now it is launched in a Terminal

Indeed, I'm doing a big refactoring to use terminal instead of console to benefit with syntax coloration of the cli, replay the command (or an another) inside terminal, answer to some cli question ("override it?" like)

Which OS do you use?

Previously, the command node <path_to_ng_from_preferences> build/serve was executed but now it just launches the ng build which fails as I do not have ng added to my system Path variable and neither can I add it due to corporate policies

Now <path_to_ng_from_preferences> should be the directory which contains the "ng" / "ng.cmd". Please check the CLI Preferences (I have improved too this preferences to see the CLI Version, CLI Path).

At the end, I suggest you to use @angular/cli and not angular-cli which is now old.

from angular-eclipse.

sayantansinha avatar sayantansinha commented on June 12, 2024

Which OS do you use?

Windows 7

Now <path_to_ng_from_preferences> should be the directory which contains the "ng" / "ng.cmd". Please check the CLI Preferences (I have improved too this preferences to see the CLI Version, CLI Path).

Yes I do see that, but I also see a problem here, if I add the physical path by browsing file system it is able to recognize and show the CLI Version and path as you have said, but if I use eclipse environment variable (like "${project_loc:node_modules/.bin}") or use workspace path by "Browse Workpsace" and pointing to the exact same path, it throws the error that it is not able to find it. The path in question here is the.bin folder in my project's node_modules.

The problem here is that, even if it recognizes the path and shows the CLI version and path in preferences, but when it executes the command it never uses that path, instead it seems to expect a global ng installation and therefore executes the "ng serve" command instead of the earlier command "node <path_to_ng_from_preferences>/ng serve" which has been working fine for me

At the end, I suggest you to use @angular/cli and not angular-cli which is now old.

Yes, I am using @angular/cli

from angular-eclipse.

sayantansinha avatar sayantansinha commented on June 12, 2024

Any help on this would be really great

from angular-eclipse.

angelozerr avatar angelozerr commented on June 12, 2024

Before opening the terminal to execute a "ng" command, the "PATH" env is updated by adding at first your node path and ng path.

After that the terminal is opened by executing the "ng build" by the Eclipse launch, could you type:

echo %PATH%

And check that your $project/node_modules/.bin directory is in the path.

from angular-eclipse.

sayantansinha avatar sayantansinha commented on June 12, 2024

Now, I think I know where the issue is, actually since I am doing this on my work laptop which does not give me admin privileges and therefore the PATH variable is not set. Is it possible to use the whole custom path for running the command instead of setting it to the PATH variable?

from angular-eclipse.

angelozerr avatar angelozerr commented on June 12, 2024

At first I have decided to use PATH env variable because :

  • ng needs node. So even if you can call ng file, if your node is not in your path, it will not work.
  • it avoids to select ng.cmd for windows and ng for other OS, so your preferences of ng is the same for any OS.

If you type:

echo %PATH%

What is your Path? Is it empty? If it that it's strange because I create this variable even if it doesn't exists.

If it is empty, please reinstall 1.2.0-SNAPSHOT and tell me if your PATH is empty or not. Thanks

from angular-eclipse.

sayantansinha avatar sayantansinha commented on June 12, 2024

Since, I had node installed using the installer it does exist already in my path, adding ng would take a lot of bureaucracy which I want to avoid. So, if you can just allow ng to run withe the full path it would suffice.
My PATH is definitely not empty as I have other entries along with the node one

from angular-eclipse.

angelozerr avatar angelozerr commented on June 12, 2024

But have you in your PATH env the path of ng directory that you have customized with preferences?

from angular-eclipse.

sayantansinha avatar sayantansinha commented on June 12, 2024

No it is not there, as when I run Eclipse with this plugin as you said it tries to add to my Path variable before the terminal launches which the system would not allow as I do not have admin access. Node was installed by a admin user which added the node path to PATH so the node path is already there

from angular-eclipse.

angelozerr avatar angelozerr commented on June 12, 2024

No it is not there, as when I run Eclipse with this plugin

I update the PATH before opening the terminal. Please reinstall 1.2.0-SNAPSH

from angular-eclipse.

sayantansinha avatar sayantansinha commented on June 12, 2024

Ok already shut my laptop, will try it out tomorrow and update. Just curious, did you change this after I reported the issue?

from angular-eclipse.

angelozerr avatar angelozerr commented on June 12, 2024

Indeed that very strange. If you can debug it, it should be very cool.

from angular-eclipse.

angelozerr avatar angelozerr commented on June 12, 2024

@sayantansinha I have added a checkbox "Execute ng with file?" to execute ng with the ng.cmd file. So you must select the directory of ng (like today) and select this checkbox.

We have a problem with build since textmate.java was migrated to Eclipse.org. Once this problem will be fixed you will able to reinstall 1.2.0-SNAPSHOT to test this new preference.

from angular-eclipse.

sayantansinha avatar sayantansinha commented on June 12, 2024

Ok got it, will wait for your update then to reinstall. Btw, is there any logs where I can check what is going on in the background, might help you with narrowing down the issue. It sounds to me like an issue with work laptops where admin rights are restricted.

from angular-eclipse.

angelozerr avatar angelozerr commented on June 12, 2024

It sounds to me like an issue with work laptops where admin rights are restricted.

Yes perhaps the update of Path that it is done before the open of terminal is not applied in this context? I cannot test that. If you can execute typescript.java with sources and debug it, it should be very cool.

from angular-eclipse.

sayantansinha avatar sayantansinha commented on June 12, 2024

With the new preference it works now as it is using the full path. Thanks.
However, once it is enabled you cannot remove it from preferences.

One additional thing that you might look into, if I run one of the commands with a set preference then the "Eclipse->Run Configuration" option stores that preference permanently, and it does not change if I change the Eclipse preferences for Angular CLI, so it continues to run with the previous preference configuration. Should it behave like that? Or should it always pick up the latest preference? Just a thought tha tyou might want to consider.

from angular-eclipse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.