angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng command not found on archlinux

Open ubgen opened this issue 9 years ago • 3 comments

Hello, I am trying to start a MEAN project with Angular Cli, the problem is that bash does not find ng command.

N.B. I installed @angular/cli locally, not globally. Here is my npm list --depth=0 output:

[ubarch@ubarch_725_g2 ~]$ npm list --depth=0 [email protected] /home/ubarch ├── @angular/[email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]

npm_list

I found ng into the path ~/node_modules/@angular/cli/bin and I can execute it if I call using ./ng, the output is in the following screeshot.

ng_version

What have I do to make ng usable without invoking it with ./ ?

ubgen avatar Nov 28 '17 14:11 ubgen

Angular CLI can either be install globally (npm i -g @angular/cli) or locally on a project (same command but without -g).

In your case you're installing it locally but not on a project. You're just installing it in your user directory. That won't work because your user directory is not really a CLI project.

I recommend that you either do a global install or create a real project to install Angular CLI in. Then you can add a npm script to your package.json that calls it (e.g. "ng": "ng",) and call commands with npm run ng -- args --flags).

That way you get a fully local CLI. But the half local half global approach you're trying is not supported.

filipesilva avatar Nov 30 '17 10:11 filipesilva

Thank you very much for the advice, I didn't know.

ubgen avatar Nov 30 '17 10:11 ubgen

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.