Git Product home page Git Product logo

Comments (37)

ziishaned avatar ziishaned commented on July 23, 2024 57

For me, running the following commands solves the issue:

rm -rf /Users/your_username/.config/yarn/global/node_modules/npm/
yarn global upgrade

from npmlog.

prewk avatar prewk commented on July 23, 2024 42

@thlavacek FYI: just deleting node_modules/npm followed by a yarn install is sufficient to make it work correctly again. No need to delete the whole node_modules dir.

from npmlog.

thecoderscott avatar thecoderscott commented on July 23, 2024 16

I've been running into this issue after performing some legacy development which involved downgrading to node v6.9.0 (npm v3.10.8) via "n" which was installed through brew.

I couldn't run any npm commands and was throwing the above error, regardless of which project directory I was in. Even upgrading back to 10.4.0 (again, via n) didn't resolve the issue.

To resolve, I had to install node v9.4.0 (npm v5.6.0) then switch back to 10.4.0 and remove the unrequired node versions. Haven't had an issue since.

Not sure if that will help your issues, but thought i'd post my solution.

from npmlog.

tigerjie2015 avatar tigerjie2015 commented on July 23, 2024 15

After switching Node.js versions using n, npm may not work properly. For me, running the following commands solves the issue:
curl -0 -L https://npmjs.com/install.sh | sudo sh

from npmlog.

gfornari avatar gfornari commented on July 23, 2024 8

I just ran into this on Ubuntu 16.04 with node v10.13.0. Using n:

  1. switch to a working node version (node v8.11.4 for me)
  2. upgrade npm to the latest version (npm v6.4.1 currently)
  3. switch back to node v10.13.0
  4. remove node_modules and package-lock.json (don't know if the latter is needed)
  5. reinstall the packages

It seems to work now.

from npmlog.

bcaplan avatar bcaplan commented on July 23, 2024 7

I've been running into this constantly since switching from npm to yarn. I've needed to blow out the node_modules folder and reinstall with yarn to get around it. It seems removing just the npmlog install directory in node_modules works sometimes as well.

from npmlog.

dazinator avatar dazinator commented on July 23, 2024 6

I just experienced this on Windows 10, upgrading from an older version of node (v6 something) to v8.12.0.

After upgrading, I tried to npm install typescript -g and it resulted in this error.

I deleted:

  • C:\Program Files\nodejs (included a node_modules sub directory)
  • C:\Users\[UserName]\AppData\Roaming\npm
  • C:\Users\[UserName]\AppData\Roaming\npm-cache

Then re-installed v8.12.0. - and it now works.

from npmlog.

thlavacek avatar thlavacek commented on July 23, 2024 5

Not sure if it'll help others, but this workaround worked the few times where I work. The workaround we do is to do a "rm -rf" (or delete the folder in Windows) of the node_modules for the project being built, and try again. The build should download all necessary dependencies to node_modules and build successfully. Your mileage may vary.

from npmlog.

tylerlong avatar tylerlong commented on July 23, 2024 4

Not sure if it's relevant. I reported this issue when I am using npm-check-updates package. Half a year later this issue still unresolved.

So I created my own package yarn-upgrade-all to replace npm-check-updates.

Not a direct solution to this problem though.

from npmlog.

JasonKleban avatar JasonKleban commented on July 23, 2024 3

This is still an issue.

npm --prefix .\node_modules\npm\node_modules\npmlog install fixes it temporarily, but some interplay between npm install and yarn makes it come back (not that it's right that we're using both!). And that fix takes minutes.

Anyone know what the cause is?

from npmlog.

prewk avatar prewk commented on July 23, 2024 3

Delete node_modules/npm and then run yarn install again. That's it. Don't delete your whole computer and upgrade all programs on it, you don't need to.

from npmlog.

chinesedfan avatar chinesedfan commented on July 23, 2024 2

isEnabled is a new function added by [email protected]. After checked the folder hierarchy, I found npmlog executes a wrong version of gauge.

You can also try this simple example, yarn#3202.

from npmlog.

adamthebig avatar adamthebig commented on July 23, 2024 2

Removing node_modules and then running yarn to rebuild does indeed remove the error.

My best guess is that since most of us probably added ember-electron after the offending version of gauge was already present... the error was there just waiting for us all ;)

I bet creating a fresh project and package.json with ember-electron (and everything else), then running yarn would not reproduce the error, because the newer version of gauge would be installed.

TLDR; Remove your node_modules folder and then run yarn to rebuild your dependency tree.

from npmlog.

IAMtheIAM avatar IAMtheIAM commented on July 23, 2024 2

What is real solution? I don't want to reinstall package each time, should just work. It only happens for me if I do yarn install ,. whereas npm install works fine. But npm is so slow to install...

I just do npm i npmlog and it fixes it for me.

from npmlog.

EisRoot avatar EisRoot commented on July 23, 2024 1

I solved this problem just now.
Replace "C:\Program Files\nodejs\node_modules\npm\node_modules\gauge"
with "C:\Program Files\nodejs\node_modules\npm\node_modules\npmlog\node_modules\gauge"

Hope it works for you guys.

from npmlog.

ccices avatar ccices commented on July 23, 2024 1

So, I got it to work.
Uninstalled nodejs and then deleted the nodejs file completely from /Program Files/
Downloaded 11.11.0 msi and selected the install all dependencies option (3rd or forth screen when installing)
Shazzam. it worked.

I have not tried 10.15.3 with the install all dependencies selected yet.

from npmlog.

zrss avatar zrss commented on July 23, 2024 1

For me, running the following commands solves the issue:

rm -rf /Users/your_username/.config/yarn/global/node_modules/npm/
yarn global upgrade

rm -rf installed npm of nodejs, as my local installed path D:\Program Files\nodejs\node_modules\npm\ and re-exec npm install xxx command works for me

from npmlog.

 avatar commented on July 23, 2024

What is it? I have the same problem with npm-check-updates...

from npmlog.

benoror avatar benoror commented on July 23, 2024

We've been running with this issue with Codeship builds randomly, any ideas?

from npmlog.

zeekay avatar zeekay commented on July 23, 2024

I have run into this when using npm and ncu programmatically when yarn is involved. Wiping out node_modules does seem to fix things.

from npmlog.

tylerlong avatar tylerlong commented on July 23, 2024

It's a npm package dependency issue. Some package depends on [email protected] while others requires earlier versions. Problem is earlier versions don't have isEnabled.

It could more complicated. Because npmlog latest version doesn't have this issue at all. So some other libraries requires an old version of npmlog.

Currently I have no idea how to fix it. A hard way could be: go through all the libraries, update their dependencies. We might need to send PRs to several projects which depends on npmlog or gauge .

from npmlog.

outaTiME avatar outaTiME commented on July 23, 2024

Same here:

screen shot 2017-04-21 at 11 46 19 am

from npmlog.

 avatar commented on July 23, 2024

I confirm the problem is still present. I removed npm-check-updates from my package.json at all.

from npmlog.

huang-xiao-jian avatar huang-xiao-jian commented on July 23, 2024

I reinstall node, then reinstall package fix this issue.

from npmlog.

JoshuaKGoldberg avatar JoshuaKGoldberg commented on July 23, 2024

or delete the folder in Windows

FWIW, the equivalent is rmdir /s /q node_modules. Posting here because I forget this every few weeks and have to look it up again. 😄

Deleting node_modules does still fix the issue on Windows.

from npmlog.

kallekoenig avatar kallekoenig commented on July 23, 2024

[Win 8.1, GitBash, nvm, npm 6.11.2] Deleting the node_modules folder and uninstalling the npm/reinstalling via nvm solved the problem for me.

from npmlog.

iarna avatar iarna commented on July 23, 2024

In so far as I can tell this is a yarn bug? npmlog declares its dependencies correctly and it is the responsibility of the package manager to ensure that those are available in a place where node's require will find it.

from npmlog.

 avatar commented on July 23, 2024

I also experienced this problem. I ended up having to uninstall nodejs, manually ensuring all files were removed from the machine and reinstall. to be safe, I rebooted prior to reinstall. But the important note, because I had tried it a few times, is that ALL node files must be removed so that it's a clean install. Hope that helps someone. I burned too much time on that. :(

from npmlog.

Netpolice avatar Netpolice commented on July 23, 2024

Just remove C:\Users[UserName]\AppData\Roaming\npm-cache
and resinstall the node.js again
it works for me

from npmlog.

ccices avatar ccices commented on July 23, 2024

So I just installed nodejs (10.5.3 LTS) on a windows machine and out of the box I get the error;


C:\Users\Bob>npm -v
C:\Program Files\nodejs\node_modules\npm\node_modules\npmlog\log.js:57
log.progressEnabled = log.gauge.isEnabled()

TypeError: log.gauge.isEnabled is not a function
at Object. (C:\Program Files\nodejs\node_modules\npm\node_modules\npmlog\log.js:57:33)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:22:13
at Object. (C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:153:3)
C:\Program Files\nodejs\node_modules\npm\node_modules\npmlog\log.js:57
log.progressEnabled = log.gauge.isEnabled()`


I have read through the above comments and can't for the life of me see the best solution to fix this issue. I suspect it has something to do with the version of gauge after reading what is above. I don't show a \npm-cache folder in \roaming to delete
Can someone put me on the straight and narrow to fix this?

from npmlog.

mu88 avatar mu88 commented on July 23, 2024

Here the same... installed 11.11.0 (Windows x64), ran npm -v- BOOM.
Uninstalled 11.11.0, installed 8.15.1 (Windows x64), ran npm -v- BOOM.

Cannot use npm at all :(

from npmlog.

airclough avatar airclough commented on July 23, 2024

I've been running into this issue after performing some legacy development which involved downgrading to node v6.9.0 (npm v3.10.8) via "n" which was installed through brew.

I couldn't run any npm commands and was throwing the above error, regardless of which project directory I was in. Even upgrading back to 10.4.0 (again, via n) didn't resolve the issue.

To resolve, I had to install node v9.4.0 (npm v5.6.0) then switch back to 10.4.0 and remove the unrequired node versions. Haven't had an issue since.

Not sure if that will help your issues, but thought i'd post my solution.

Same exact issue as quoted above. Went from v10 to v6 and back, via n. Tried to use create-react-app, ended up here.

n prune command didn't work because I was using an older version of n. In turn, I manually removed all versions not in use. New error when trying to use npm:

Cannot read property 'resolve' of undefined

Looks like some promise wires got crossed somewhere. Decided to wipe my global node_modules folder clean and reinstall node through the official installer. Had originally installed via brew a few years back.

Not sure if this was the best solution, but it worked and I'm over it. Reinstalled a few global packages and all is good.

from npmlog.

jimmy-chow avatar jimmy-chow commented on July 23, 2024

I just experienced this on Windows 10, upgrading from an older version of node (v6 something) to v8.12.0.

After upgrading, I tried to npm install typescript -g and it resulted in this error.

I deleted:

  • C:\Program Files\nodejs (included a node_modules sub directory)
  • C:\Users\[UserName]\AppData\Roaming\npm
  • C:\Users\[UserName]\AppData\Roaming\npm-cache

Then re-installed v8.12.0. - and it now works.

This method does work for me.

from npmlog.

Jasonlhy avatar Jasonlhy commented on July 23, 2024

My solution is to:

  1. Uninstall node.js
  2. Remove everything inside C:\Program Files\nodejs
  3. Install node.js

from npmlog.

wraithgar avatar wraithgar commented on July 23, 2024

This does not appear to be a problem in the latest npmlog or npm cli. If this is happening in npmlog ^5.0.0 please open a new issue.

from npmlog.

wuang1992 avatar wuang1992 commented on July 23, 2024

For me, running the following commands solves the issue:

rm -rf /Users/your_username/.config/yarn/global/node_modules/npm/
yarn global upgrade

thx, it's worked for me

from npmlog.

wetbadger avatar wetbadger commented on July 23, 2024

I have this problem but I don't use yarn... Reinstalling node doesn't help.

edit: uninstalling nodejs and then deleting the folder /usr/lib/node_modules fixed it.

from npmlog.

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.