Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

ng command collides with angular-cli #110

Closed
mckennapsean opened this issue Dec 3, 2017 · 4 comments
Closed

ng command collides with angular-cli #110

mckennapsean opened this issue Dec 3, 2017 · 4 comments
Labels

Comments

@mckennapsean
Copy link

The default installed ng command collides with the Angular-CLI project which unfortunately uses the same command name.

This becomes an issue when you want to install both, and npm may overwrite the installed version of nailgun in /usr/local/bin which happened to me.

On Ubuntu 16.04 when you install the nailgun package (apt install nailgun), it maps nailgun to the command ng-nailgun instead of ng. Not sure if the ng collision is why, but the documentation for nailgun is now out of sync with those using Ubuntu.

Due to the popularity of both Angular-CLI and Ubuntu, I would suggest considering another command name to be consistent across platforms. While ng-nailgun is a bit long, anyone can always link it to ng for existing scripts.

On that note though, thanks for this awesome tool! My company uses the protocol for a Node server to speed up running Node.js scripts: Nodegun.

@CaelumF
Copy link

CaelumF commented Feb 19, 2018

ng
>Connection refused...

whereis ng
>ng: /usr/bin/ng /usr/local/bin
sudo mv /usr/bin/ng /usr/bin/ng2
sudo mv /usr/local/bin/ng /usr/local/bin/ng2
sudo npm install -g @angular/cli
sudo ln -s /usr/lib/node_modules/@angular/cli/bin/ng /usr/local/bin/ng

ng
>ng build <options...> ...

Workaround for changing nailgun to ng2 and getting ng to refer to Angular CLI

@mckennapsean
Copy link
Author

mckennapsean commented Feb 20, 2018

Did not work for me.

Running NailGun's ng command when installed (or nailgun on Ubuntu) without any parameters/args prints out the help text.

When you move the file (ng -> ng2, or basically ng -> *), then this breaks, and you get the "Connection refused" instead of the help text. At least for my company's build workflow, when I tried moving the NailGun executable, then our build stopped working, printing out "Connection refused".

Not sure why simply renaming the executable causes these issues unless it is hardcoded somewhere. You also cannot symlink it to any other name.

Here is the help text / version I am getting when it is successful:

NailGun v0.9.0

Usage: ng class [--nailgun-options] [args]
          (to execute a class)
   or: ng alias [--nailgun-options] [args]
          (to execute an aliased class)
   or: alias [--nailgun-options] [args]
          (to execute an aliased class, where "alias"
           is both the alias for the class and a symbolic
           link to the ng client)

where options include:
   --nailgun-D<name>=<value>   set/override a client environment variable
   --nailgun-version           print product version and exit
   --nailgun-showversion       print product version and continue
   --nailgun-server            to specify the address of the nailgun server
                               (default is NAILGUN_SERVER environment variable
                               if set, otherwise localhost)
   --nailgun-port              to specify the port of the nailgun server
                               (default is NAILGUN_PORT environment variable
                               if set, otherwise 2113)
   --nailgun-filearg FILE      places the entire contents of FILE into the
                               next argument, which is interpreted as a string
                               using the server's default character set.  May be
                               specified more than once.
   --nailgun-help              print this message and exit

@CaelumF
Copy link

CaelumF commented Feb 20, 2018

Could you give Angular CLI a different name instead?
ie
sudo ln -s /usr/lib/node_modules/@angular/cli/bin/ng /usr/local/bin/ang

@mckennapsean
Copy link
Author

Oh, of course, that works fine to use Angular (and ultimately what I did to play with angular-cli).

The maintainers do not seem open to a name-change though. Feel free to see #111 for more on the issue with the binary. I am curious to see why so may dig into that issue when I have some spare time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants