ng: command not found
I am trying to run ng build
in my project folder, but I get the following response:
bash: ng: command not found
What am I missing? Does it have to do with admin privileges, my path/profile, or something I need to install globally?
This is my package.json
:
{
"name": "meanauthapp",
"version": "1.0.0",
"description": "MEAN stack authentication app",
"main": "app.js",
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "4.16.2",
"mongoose": "4.13.6",
"bcryptjs": "2.4.3",
"cors": "2.8.4",
"jsonwebtoken": "8.1.0",
"body-parser": "1.18.2",
"passport": "0.4.0",
"passport-jwt": "3.0.1"
},
"author": "",
"license": "MIT",
"devDependencies": {
"@angular/cli": "^1.6.0"
}
}
angular angular-cli
add a comment |
I am trying to run ng build
in my project folder, but I get the following response:
bash: ng: command not found
What am I missing? Does it have to do with admin privileges, my path/profile, or something I need to install globally?
This is my package.json
:
{
"name": "meanauthapp",
"version": "1.0.0",
"description": "MEAN stack authentication app",
"main": "app.js",
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "4.16.2",
"mongoose": "4.13.6",
"bcryptjs": "2.4.3",
"cors": "2.8.4",
"jsonwebtoken": "8.1.0",
"body-parser": "1.18.2",
"passport": "0.4.0",
"passport-jwt": "3.0.1"
},
"author": "",
"license": "MIT",
"devDependencies": {
"@angular/cli": "^1.6.0"
}
}
angular angular-cli
add a comment |
I am trying to run ng build
in my project folder, but I get the following response:
bash: ng: command not found
What am I missing? Does it have to do with admin privileges, my path/profile, or something I need to install globally?
This is my package.json
:
{
"name": "meanauthapp",
"version": "1.0.0",
"description": "MEAN stack authentication app",
"main": "app.js",
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "4.16.2",
"mongoose": "4.13.6",
"bcryptjs": "2.4.3",
"cors": "2.8.4",
"jsonwebtoken": "8.1.0",
"body-parser": "1.18.2",
"passport": "0.4.0",
"passport-jwt": "3.0.1"
},
"author": "",
"license": "MIT",
"devDependencies": {
"@angular/cli": "^1.6.0"
}
}
angular angular-cli
I am trying to run ng build
in my project folder, but I get the following response:
bash: ng: command not found
What am I missing? Does it have to do with admin privileges, my path/profile, or something I need to install globally?
This is my package.json
:
{
"name": "meanauthapp",
"version": "1.0.0",
"description": "MEAN stack authentication app",
"main": "app.js",
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "4.16.2",
"mongoose": "4.13.6",
"bcryptjs": "2.4.3",
"cors": "2.8.4",
"jsonwebtoken": "8.1.0",
"body-parser": "1.18.2",
"passport": "0.4.0",
"passport-jwt": "3.0.1"
},
"author": "",
"license": "MIT",
"devDependencies": {
"@angular/cli": "^1.6.0"
}
}
angular angular-cli
angular angular-cli
edited Jul 25 '18 at 11:32
Hasan Fathi
2,21012026
2,21012026
asked Jul 25 '18 at 5:09
chodychody
548
548
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
try to uninstall and clean the cache.
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli
The package name is@angular/cli
– JSON Derulo
Jul 25 '18 at 6:05
add a comment |
In case others come here with this issue as I have, here is how I solved it system-wide on MacOS. Hope this helps.
Verify node is installed:
$ node -v
v11.2.0
Verify npm is installed:
$ npm -v
6.4.1
Verify your npm global install file path is configured (known as prefix). Mine is under ~/.npm-packages:
$ npm config ls -l | grep prefix
prefix = "/Users/christiangroleau/.npm-packages"
If not, you can place it into your ~/.npmrc file:
echo prefix=~/.npm-packages >> ~/.npmrc
Verify that your prefix path is listed in your system PATH:
$ echo $PATH
/Users/christiangroleau/.npm-packages/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
If not, invoke the following:
export PATH="$HOME/.npm-packages/bin:$PATH"
Finally, you can reinstall angular-cli (in my case I needed to install it globally):
$ npm install -g @angular/cli
Verify installation:
$ ng -v
add a comment |
Try this:
node_modules/.bin/ng build
Or better, add a blank "ng": "ng"
line into your scripts
key in package.json and run this:
`npm run ng build`
You could also add this to your path:
export PATH=$PATH:./node_modules/bin
Which would let you run any binary in any npm project you might have.
add a comment |
npm
doesn't recognize ng
command.
Try this command:
npm link @angular/cli
to link npm
and angular-cli
.
add a comment |
You need to install the Angular CLI globally.
Run npm install -g @angular/cli
I already have the Angular CLI installed globally and it still doesn't work.
– chody
Jul 25 '18 at 5:57
@chody then this is not Angular CLI related. It seems like it is a general problem that you can't install global NPM packages. Maybe this helps you: stackoverflow.com/questions/15054388/…
– JSON Derulo
Jul 25 '18 at 6:05
@chody can you please make sure angular cli is installed usingnpm list -g --depth 0
, i loose my global installed packages Everytime I update node.
– sn42
Jul 25 '18 at 6:06
@sn42 I did that and it returned a lot of errors. What should I do to remedy this?
– chody
Jul 25 '18 at 6:11
@chody might be helpful to share the errors then
– sn42
Jul 25 '18 at 6:26
|
show 1 more comment
Based on your comments to other answers: This npm issue might be related to your problem, your npm installation might be outdated.
First of check whether you use a recent version of node. Then update npm with npm i -g npm
as the issue suggests (near bottom). Then if ng
is still not found follow the update instructions of @angular/cli:
npm uninstall -g @angular/cli
npm cache verify
# if npm version is < 5 then use 'npm cache clean'
npm install -g @angular/cli@latest
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51511183%2fng-command-not-found%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
try to uninstall and clean the cache.
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli
The package name is@angular/cli
– JSON Derulo
Jul 25 '18 at 6:05
add a comment |
try to uninstall and clean the cache.
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli
The package name is@angular/cli
– JSON Derulo
Jul 25 '18 at 6:05
add a comment |
try to uninstall and clean the cache.
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli
try to uninstall and clean the cache.
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli
edited Jul 25 '18 at 6:06
answered Jul 25 '18 at 6:04
Sachila RanawakaSachila Ranawaka
19.9k32649
19.9k32649
The package name is@angular/cli
– JSON Derulo
Jul 25 '18 at 6:05
add a comment |
The package name is@angular/cli
– JSON Derulo
Jul 25 '18 at 6:05
The package name is
@angular/cli
– JSON Derulo
Jul 25 '18 at 6:05
The package name is
@angular/cli
– JSON Derulo
Jul 25 '18 at 6:05
add a comment |
In case others come here with this issue as I have, here is how I solved it system-wide on MacOS. Hope this helps.
Verify node is installed:
$ node -v
v11.2.0
Verify npm is installed:
$ npm -v
6.4.1
Verify your npm global install file path is configured (known as prefix). Mine is under ~/.npm-packages:
$ npm config ls -l | grep prefix
prefix = "/Users/christiangroleau/.npm-packages"
If not, you can place it into your ~/.npmrc file:
echo prefix=~/.npm-packages >> ~/.npmrc
Verify that your prefix path is listed in your system PATH:
$ echo $PATH
/Users/christiangroleau/.npm-packages/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
If not, invoke the following:
export PATH="$HOME/.npm-packages/bin:$PATH"
Finally, you can reinstall angular-cli (in my case I needed to install it globally):
$ npm install -g @angular/cli
Verify installation:
$ ng -v
add a comment |
In case others come here with this issue as I have, here is how I solved it system-wide on MacOS. Hope this helps.
Verify node is installed:
$ node -v
v11.2.0
Verify npm is installed:
$ npm -v
6.4.1
Verify your npm global install file path is configured (known as prefix). Mine is under ~/.npm-packages:
$ npm config ls -l | grep prefix
prefix = "/Users/christiangroleau/.npm-packages"
If not, you can place it into your ~/.npmrc file:
echo prefix=~/.npm-packages >> ~/.npmrc
Verify that your prefix path is listed in your system PATH:
$ echo $PATH
/Users/christiangroleau/.npm-packages/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
If not, invoke the following:
export PATH="$HOME/.npm-packages/bin:$PATH"
Finally, you can reinstall angular-cli (in my case I needed to install it globally):
$ npm install -g @angular/cli
Verify installation:
$ ng -v
add a comment |
In case others come here with this issue as I have, here is how I solved it system-wide on MacOS. Hope this helps.
Verify node is installed:
$ node -v
v11.2.0
Verify npm is installed:
$ npm -v
6.4.1
Verify your npm global install file path is configured (known as prefix). Mine is under ~/.npm-packages:
$ npm config ls -l | grep prefix
prefix = "/Users/christiangroleau/.npm-packages"
If not, you can place it into your ~/.npmrc file:
echo prefix=~/.npm-packages >> ~/.npmrc
Verify that your prefix path is listed in your system PATH:
$ echo $PATH
/Users/christiangroleau/.npm-packages/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
If not, invoke the following:
export PATH="$HOME/.npm-packages/bin:$PATH"
Finally, you can reinstall angular-cli (in my case I needed to install it globally):
$ npm install -g @angular/cli
Verify installation:
$ ng -v
In case others come here with this issue as I have, here is how I solved it system-wide on MacOS. Hope this helps.
Verify node is installed:
$ node -v
v11.2.0
Verify npm is installed:
$ npm -v
6.4.1
Verify your npm global install file path is configured (known as prefix). Mine is under ~/.npm-packages:
$ npm config ls -l | grep prefix
prefix = "/Users/christiangroleau/.npm-packages"
If not, you can place it into your ~/.npmrc file:
echo prefix=~/.npm-packages >> ~/.npmrc
Verify that your prefix path is listed in your system PATH:
$ echo $PATH
/Users/christiangroleau/.npm-packages/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
If not, invoke the following:
export PATH="$HOME/.npm-packages/bin:$PATH"
Finally, you can reinstall angular-cli (in my case I needed to install it globally):
$ npm install -g @angular/cli
Verify installation:
$ ng -v
answered Nov 25 '18 at 19:48
Christian GroleauChristian Groleau
6061817
6061817
add a comment |
add a comment |
Try this:
node_modules/.bin/ng build
Or better, add a blank "ng": "ng"
line into your scripts
key in package.json and run this:
`npm run ng build`
You could also add this to your path:
export PATH=$PATH:./node_modules/bin
Which would let you run any binary in any npm project you might have.
add a comment |
Try this:
node_modules/.bin/ng build
Or better, add a blank "ng": "ng"
line into your scripts
key in package.json and run this:
`npm run ng build`
You could also add this to your path:
export PATH=$PATH:./node_modules/bin
Which would let you run any binary in any npm project you might have.
add a comment |
Try this:
node_modules/.bin/ng build
Or better, add a blank "ng": "ng"
line into your scripts
key in package.json and run this:
`npm run ng build`
You could also add this to your path:
export PATH=$PATH:./node_modules/bin
Which would let you run any binary in any npm project you might have.
Try this:
node_modules/.bin/ng build
Or better, add a blank "ng": "ng"
line into your scripts
key in package.json and run this:
`npm run ng build`
You could also add this to your path:
export PATH=$PATH:./node_modules/bin
Which would let you run any binary in any npm project you might have.
answered Jul 25 '18 at 6:06
ZlatkoZlatko
10.1k849100
10.1k849100
add a comment |
add a comment |
npm
doesn't recognize ng
command.
Try this command:
npm link @angular/cli
to link npm
and angular-cli
.
add a comment |
npm
doesn't recognize ng
command.
Try this command:
npm link @angular/cli
to link npm
and angular-cli
.
add a comment |
npm
doesn't recognize ng
command.
Try this command:
npm link @angular/cli
to link npm
and angular-cli
.
npm
doesn't recognize ng
command.
Try this command:
npm link @angular/cli
to link npm
and angular-cli
.
answered Jul 25 '18 at 7:40
Hasan FathiHasan Fathi
2,21012026
2,21012026
add a comment |
add a comment |
You need to install the Angular CLI globally.
Run npm install -g @angular/cli
I already have the Angular CLI installed globally and it still doesn't work.
– chody
Jul 25 '18 at 5:57
@chody then this is not Angular CLI related. It seems like it is a general problem that you can't install global NPM packages. Maybe this helps you: stackoverflow.com/questions/15054388/…
– JSON Derulo
Jul 25 '18 at 6:05
@chody can you please make sure angular cli is installed usingnpm list -g --depth 0
, i loose my global installed packages Everytime I update node.
– sn42
Jul 25 '18 at 6:06
@sn42 I did that and it returned a lot of errors. What should I do to remedy this?
– chody
Jul 25 '18 at 6:11
@chody might be helpful to share the errors then
– sn42
Jul 25 '18 at 6:26
|
show 1 more comment
You need to install the Angular CLI globally.
Run npm install -g @angular/cli
I already have the Angular CLI installed globally and it still doesn't work.
– chody
Jul 25 '18 at 5:57
@chody then this is not Angular CLI related. It seems like it is a general problem that you can't install global NPM packages. Maybe this helps you: stackoverflow.com/questions/15054388/…
– JSON Derulo
Jul 25 '18 at 6:05
@chody can you please make sure angular cli is installed usingnpm list -g --depth 0
, i loose my global installed packages Everytime I update node.
– sn42
Jul 25 '18 at 6:06
@sn42 I did that and it returned a lot of errors. What should I do to remedy this?
– chody
Jul 25 '18 at 6:11
@chody might be helpful to share the errors then
– sn42
Jul 25 '18 at 6:26
|
show 1 more comment
You need to install the Angular CLI globally.
Run npm install -g @angular/cli
You need to install the Angular CLI globally.
Run npm install -g @angular/cli
answered Jul 25 '18 at 5:55
JSON DeruloJSON Derulo
1,58611220
1,58611220
I already have the Angular CLI installed globally and it still doesn't work.
– chody
Jul 25 '18 at 5:57
@chody then this is not Angular CLI related. It seems like it is a general problem that you can't install global NPM packages. Maybe this helps you: stackoverflow.com/questions/15054388/…
– JSON Derulo
Jul 25 '18 at 6:05
@chody can you please make sure angular cli is installed usingnpm list -g --depth 0
, i loose my global installed packages Everytime I update node.
– sn42
Jul 25 '18 at 6:06
@sn42 I did that and it returned a lot of errors. What should I do to remedy this?
– chody
Jul 25 '18 at 6:11
@chody might be helpful to share the errors then
– sn42
Jul 25 '18 at 6:26
|
show 1 more comment
I already have the Angular CLI installed globally and it still doesn't work.
– chody
Jul 25 '18 at 5:57
@chody then this is not Angular CLI related. It seems like it is a general problem that you can't install global NPM packages. Maybe this helps you: stackoverflow.com/questions/15054388/…
– JSON Derulo
Jul 25 '18 at 6:05
@chody can you please make sure angular cli is installed usingnpm list -g --depth 0
, i loose my global installed packages Everytime I update node.
– sn42
Jul 25 '18 at 6:06
@sn42 I did that and it returned a lot of errors. What should I do to remedy this?
– chody
Jul 25 '18 at 6:11
@chody might be helpful to share the errors then
– sn42
Jul 25 '18 at 6:26
I already have the Angular CLI installed globally and it still doesn't work.
– chody
Jul 25 '18 at 5:57
I already have the Angular CLI installed globally and it still doesn't work.
– chody
Jul 25 '18 at 5:57
@chody then this is not Angular CLI related. It seems like it is a general problem that you can't install global NPM packages. Maybe this helps you: stackoverflow.com/questions/15054388/…
– JSON Derulo
Jul 25 '18 at 6:05
@chody then this is not Angular CLI related. It seems like it is a general problem that you can't install global NPM packages. Maybe this helps you: stackoverflow.com/questions/15054388/…
– JSON Derulo
Jul 25 '18 at 6:05
@chody can you please make sure angular cli is installed using
npm list -g --depth 0
, i loose my global installed packages Everytime I update node.– sn42
Jul 25 '18 at 6:06
@chody can you please make sure angular cli is installed using
npm list -g --depth 0
, i loose my global installed packages Everytime I update node.– sn42
Jul 25 '18 at 6:06
@sn42 I did that and it returned a lot of errors. What should I do to remedy this?
– chody
Jul 25 '18 at 6:11
@sn42 I did that and it returned a lot of errors. What should I do to remedy this?
– chody
Jul 25 '18 at 6:11
@chody might be helpful to share the errors then
– sn42
Jul 25 '18 at 6:26
@chody might be helpful to share the errors then
– sn42
Jul 25 '18 at 6:26
|
show 1 more comment
Based on your comments to other answers: This npm issue might be related to your problem, your npm installation might be outdated.
First of check whether you use a recent version of node. Then update npm with npm i -g npm
as the issue suggests (near bottom). Then if ng
is still not found follow the update instructions of @angular/cli:
npm uninstall -g @angular/cli
npm cache verify
# if npm version is < 5 then use 'npm cache clean'
npm install -g @angular/cli@latest
add a comment |
Based on your comments to other answers: This npm issue might be related to your problem, your npm installation might be outdated.
First of check whether you use a recent version of node. Then update npm with npm i -g npm
as the issue suggests (near bottom). Then if ng
is still not found follow the update instructions of @angular/cli:
npm uninstall -g @angular/cli
npm cache verify
# if npm version is < 5 then use 'npm cache clean'
npm install -g @angular/cli@latest
add a comment |
Based on your comments to other answers: This npm issue might be related to your problem, your npm installation might be outdated.
First of check whether you use a recent version of node. Then update npm with npm i -g npm
as the issue suggests (near bottom). Then if ng
is still not found follow the update instructions of @angular/cli:
npm uninstall -g @angular/cli
npm cache verify
# if npm version is < 5 then use 'npm cache clean'
npm install -g @angular/cli@latest
Based on your comments to other answers: This npm issue might be related to your problem, your npm installation might be outdated.
First of check whether you use a recent version of node. Then update npm with npm i -g npm
as the issue suggests (near bottom). Then if ng
is still not found follow the update instructions of @angular/cli:
npm uninstall -g @angular/cli
npm cache verify
# if npm version is < 5 then use 'npm cache clean'
npm install -g @angular/cli@latest
answered Jul 25 '18 at 13:55
sn42sn42
8881319
8881319
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51511183%2fng-command-not-found%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown