Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: log.gauge.isEnabled is not a function #333

Closed
2 tasks done
ghost opened this issue Mar 13, 2017 · 13 comments
Closed
2 tasks done

TypeError: log.gauge.isEnabled is not a function #333

ghost opened this issue Mar 13, 2017 · 13 comments

Comments

@ghost
Copy link

ghost commented Mar 13, 2017

  • node version: 7.7.2
  • npm version: 4.4.1
  • npm-check-updates version: 2.10.3
  • Windows 10 x64

Sometimes I receive this (using ncu or ncu -g):

C:\Projects\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> (C:\Projects\node_modules\npm\node_modules\npmlog\log.js:57:33)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Projects\node_modules\npm\lib\utils\umask.js:2:14)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
@raineorshine
Copy link
Owner

Thanks for reporting! Do you ever get that error when running npm itself? It looks to be coming from npm.

@raineorshine
Copy link
Owner

If you could identify more specifically when this occurs that would be helpful as well! Thanks.

@claydiffrient
Copy link

I had this issue when I installed using: yarn global add npm-check-updates
The issue happened when I attempted to run ncu inside of a project directory.

I fixed the issue by uninstalling using: yarn global remove npm-check-updates and then reinstalling using yarn global add npm-check-updates --prefix /usr/local.

I'm not sure why that might have made a difference, but I'm up and running now.

@ghost
Copy link
Author

ghost commented Mar 21, 2017

@claydiffrient

That doesn't look to be an issue with ncu but with yarn not using npm's prefix config when installing bins from global cli tools (which is defaulted to /usr/local).

On the yarn issue tracker it looks like people use the --prefix option or just install global cli tools with npm.

@claydiffrient
Copy link

@eighty4 I agree it's not a ncu issue. I mostly just posted to make sure that anyone else that landed here knew a workaround :)

@ghost
Copy link
Author

ghost commented Mar 21, 2017

I'm not installing ncu with yarn as global tool (only with npm i -g) and still I'm having the problem...

@raineorshine
Copy link
Owner

@johnunclesam Thanks, I'd like to figure out the issue for you. I might need some more information first since I am not able to reproduce it. Do you experience this same problems with other global installs, or is it just ncu?

@chinesedfan
Copy link

I think it is an issue of yarn, please check yarn#3202.

@raineorshine
Copy link
Owner

Closing as it does not appear to be an ncu issue. Feel free to re-open if there is something that we should do. Thanks!

@vdh
Copy link

vdh commented Jul 19, 2017

I'm pretty sure this is not actually Yarn's fault. It's because of the Npm dependency mentioned in #369, which causes an installation of a second local (and probably older) copy of Npm, which then conflicts with the main global one.

@danday74
Copy link

hit this today after doing a yarn add some other packages
fixed with rm-rf node_modules THEN yarn install

@EdwardCaine
Copy link

I fixed the issue by commenting out line 57 in /usr/local/lib/node_modules/npm/node_modules/npmlog/log.js
log.progressEnabled = log.gauge.isEnabled()

@DevinXian
Copy link

DevinXian commented Aug 1, 2019

Just try to run yarn global add { any npm package }, works for me!

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

No branches or pull requests

7 participants