npm is broken and i can not run any npm command
My npm is broken and I could not run any npm command.
$ type npm
npm is hashed (/usr/local/bin/npm)
$ type node
node is hashed (/usr/local/bin/node)
$ type nodejs
nodejs is hashed (/usr/bin/nodejs)
$ uname -a
Linux mj-lp-mint 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Versions:
$ node -v
v11.0.0
$ nodejs -v
v10.13.0
Following npm command gave this error:
$ sudo npm install npm -g
/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:57
log.progressEnabled = log.gauge.isEnabled()
^
TypeError: log.gauge.isEnabled is not a function
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:57:33)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:22:13
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:153:3)
Why node and nodejs has different versions and npm -v gave same error.
node.js npm yarnpkg
add a comment |
My npm is broken and I could not run any npm command.
$ type npm
npm is hashed (/usr/local/bin/npm)
$ type node
node is hashed (/usr/local/bin/node)
$ type nodejs
nodejs is hashed (/usr/bin/nodejs)
$ uname -a
Linux mj-lp-mint 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Versions:
$ node -v
v11.0.0
$ nodejs -v
v10.13.0
Following npm command gave this error:
$ sudo npm install npm -g
/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:57
log.progressEnabled = log.gauge.isEnabled()
^
TypeError: log.gauge.isEnabled is not a function
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:57:33)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:22:13
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:153:3)
Why node and nodejs has different versions and npm -v gave same error.
node.js npm yarnpkg
add a comment |
My npm is broken and I could not run any npm command.
$ type npm
npm is hashed (/usr/local/bin/npm)
$ type node
node is hashed (/usr/local/bin/node)
$ type nodejs
nodejs is hashed (/usr/bin/nodejs)
$ uname -a
Linux mj-lp-mint 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Versions:
$ node -v
v11.0.0
$ nodejs -v
v10.13.0
Following npm command gave this error:
$ sudo npm install npm -g
/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:57
log.progressEnabled = log.gauge.isEnabled()
^
TypeError: log.gauge.isEnabled is not a function
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:57:33)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:22:13
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:153:3)
Why node and nodejs has different versions and npm -v gave same error.
node.js npm yarnpkg
My npm is broken and I could not run any npm command.
$ type npm
npm is hashed (/usr/local/bin/npm)
$ type node
node is hashed (/usr/local/bin/node)
$ type nodejs
nodejs is hashed (/usr/bin/nodejs)
$ uname -a
Linux mj-lp-mint 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Versions:
$ node -v
v11.0.0
$ nodejs -v
v10.13.0
Following npm command gave this error:
$ sudo npm install npm -g
/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:57
log.progressEnabled = log.gauge.isEnabled()
^
TypeError: log.gauge.isEnabled is not a function
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:57:33)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:22:13
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:153:3)
Why node and nodejs has different versions and npm -v gave same error.
node.js npm yarnpkg
node.js npm yarnpkg
edited Nov 13 '18 at 16:01
tk421
3,37931426
3,37931426
asked Nov 13 '18 at 6:19
M. Javad Mohebbi
887
887
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You're facing this issue. The short solution seems to be:
Delete
node_modules/npm
and then runyarn install
again.
There are other solutions in the issue comment thread.
add a comment |
I removed /usr/local/lib/node_modules/ directory and everything works correctly:
sudo rm -rfv /usr/local/lib/node_modules/
Hope it will help others ;-)
1
Please accept the answer if it helps you to solve your issue.
– TGrif
Nov 13 '18 at 21:01
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%2f53274941%2fnpm-is-broken-and-i-can-not-run-any-npm-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You're facing this issue. The short solution seems to be:
Delete
node_modules/npm
and then runyarn install
again.
There are other solutions in the issue comment thread.
add a comment |
You're facing this issue. The short solution seems to be:
Delete
node_modules/npm
and then runyarn install
again.
There are other solutions in the issue comment thread.
add a comment |
You're facing this issue. The short solution seems to be:
Delete
node_modules/npm
and then runyarn install
again.
There are other solutions in the issue comment thread.
You're facing this issue. The short solution seems to be:
Delete
node_modules/npm
and then runyarn install
again.
There are other solutions in the issue comment thread.
answered Nov 13 '18 at 6:25
Alex Taylor
5,43521533
5,43521533
add a comment |
add a comment |
I removed /usr/local/lib/node_modules/ directory and everything works correctly:
sudo rm -rfv /usr/local/lib/node_modules/
Hope it will help others ;-)
1
Please accept the answer if it helps you to solve your issue.
– TGrif
Nov 13 '18 at 21:01
add a comment |
I removed /usr/local/lib/node_modules/ directory and everything works correctly:
sudo rm -rfv /usr/local/lib/node_modules/
Hope it will help others ;-)
1
Please accept the answer if it helps you to solve your issue.
– TGrif
Nov 13 '18 at 21:01
add a comment |
I removed /usr/local/lib/node_modules/ directory and everything works correctly:
sudo rm -rfv /usr/local/lib/node_modules/
Hope it will help others ;-)
I removed /usr/local/lib/node_modules/ directory and everything works correctly:
sudo rm -rfv /usr/local/lib/node_modules/
Hope it will help others ;-)
edited Nov 15 '18 at 13:28
Samuel Liew♦
44.2k32112148
44.2k32112148
answered Nov 13 '18 at 6:40
M. Javad Mohebbi
887
887
1
Please accept the answer if it helps you to solve your issue.
– TGrif
Nov 13 '18 at 21:01
add a comment |
1
Please accept the answer if it helps you to solve your issue.
– TGrif
Nov 13 '18 at 21:01
1
1
Please accept the answer if it helps you to solve your issue.
– TGrif
Nov 13 '18 at 21:01
Please accept the answer if it helps you to solve your issue.
– TGrif
Nov 13 '18 at 21:01
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f53274941%2fnpm-is-broken-and-i-can-not-run-any-npm-command%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