Skip to content

Instantly share code, notes, and snippets.

@10thfloor
Forked from ShMcK/npm-unfuck.sh
Created November 9, 2016 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 10thfloor/eacbde319d89221bdd9e8c3012a9675a to your computer and use it in GitHub Desktop.
Save 10thfloor/eacbde319d89221bdd9e8c3012a9675a to your computer and use it in GitHub Desktop.
Quick fix for npm dependency issues. Run "bash npm-unfuck.sh"
# NPM Unfuck
# Brought to you by:
# Mackenzie Kieran & Shawn McKay
# remove deps
rm -rf node_modules
npm cache clean
# lock dependencies
sed -i '.bak' 's/"^/"/' package.json
# reinstall node_modules
if which yarn > /dev/null; then
yarn
else
npm i
fi
# say complete
say "done!"
@10thfloor
Copy link
Author

TODO:
[ ] Check if .babelrc and package.json have matching babel plugins/presets. If not install or add missing ones.
[ ] Package.json linter?

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