Skip to content

darcyclarke/faq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

FAQ

Frequently Asked Questions - this is not a complete list so expect more to be added over time...

npm

Table of Contents

"How do I speed up install?"

  • Use the latest node & npm versions (ie. brew update && brew install node & npm i -g npm@latest)
  • If you don't need dev dependencies, add the flag --production
  • If you don't need to audit, add the flag --no-audit
  • If you already have some of your modules cached, add the flag --prefer-offline

"How do I fix a failing install?"

  • Check if you're using the latest node & npm
  • Check if the registry is down
  • Check if your network is having issues (ie. slow or intermitant connection)
  • Check if your network is blocking certain requests (ie. behind a corporate firewall)
  • Check if speeding up your installs helps
  • If you're project has peer dependecy conflict warnings or failures, try adding the flag --legacy-peer-deps

"How do I generate a npm-debug.log?"

  • Add the flag --timing to any command run (ex. npm install express --timing)

"How can I get a npm-debug.log out of GitHub Actions/Workflow?"

# example: ./github/workflows/*.yml
- uses: actions/upload-artifact@v2
  with:
    name: npm-debug-logs
    path: ~/.npm/_logs/*-debug.log

"How can I audit a package without installing it?"

  • Use this npm-audit bash script (note: it runs install in a tmp directoy w/ --package-lock-only & then audit - should avoid firewalls/network issues w/ downloading vulnerable tars)

"How can I fully cache or vendor my deps so they're available offline?"

  • Set your cache config (ex. in .npmrc cache = ./some-local-cache-dir or w/ npm config set cache ./some-local-cache-dir)
  • Run npm install
  • You should now be able to run npm install w/ the flag --offline or kill your network & it'll just work™️
  • Example in the wild

About

Frequently Asked Questions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published