PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, October 21, 2022

[FIXED] How to npm audit global packages

 October 21, 2022     npm     No comments   

Issue

As stated in the official npm documentation you can manually run npm audit on locally installed packages, which must have both package.json and package-lock.json files.

Globally installed packages doesn't have package-lock.json, if you run an audit it will trow an error: npm ERR! code EAUDITNOLOCK

How can I run npm audit on all globally installed packages?


Solution

It's good to keep them up-to-date.

That's not really auditing, but with few as possible global packages, this should be fine enough.

there is npm-check-updates or alternatively npm-check

npm install -g npm-check-updates

check outdated global packages:

ncu -g        

OR

as recommended by @pldg via npx

npx npm-check-updates -g

OR

as recommended by @wheredidthatnamecomefrom

npx npm-global-audit

this is a script running with yarn. it does a temporary copy of your current global packages. see more on their github.



Answered By - André Kelling
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing