Last active
March 19, 2022 17:29
-
-
Save backviet/fb26f5e0c10adb734d391121638fcca6 to your computer and use it in GitHub Desktop.
npm helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| echo "current version $(node --version)" | |
| currpath=$PWD | |
| cd /usr/local/include | |
| rm -R node | |
| cd /usr/local/lib | |
| rm -R node_modules | |
| cd /usr/local/bin | |
| rm -R node | |
| echo "Done" | |
| cd $currpath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # This to fix bellow error: | |
| # npm ERR! code ERR_SOCKET_TIMEOUT on creating new project using ng new appname | |
| # https://stackoverflow.com/questions/67657599/npm-err-code-err-socket-timeout-on-creating-new-project-using-ng-new-appname | |
| # npm cache clear --force | |
| echo "old npm configs" | |
| npm config ls -l | |
| npm config set fetch-retry-mintimeout 20000 | |
| npm config set fetch-retry-maxtimeout 120000 | |
| echo "new npm config" | |
| npm config ls -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment