
| Current Path : /proc/thread-self/root/home/jstimm/Desktop/50_dev2017/1313__procpyjs/doc/DevPlatform/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //proc/thread-self/root/home/jstimm/Desktop/50_dev2017/1313__procpyjs/doc/DevPlatform/Fatal.md |
#Everything has gotten a Mess
If you followed along the line we've encouraged you and your packages are more and more behaving
weirdly, please consider to delete everything you've installed globally and start from
scratch using a sane environment as proposed.
##Delete all globally installed packages
```
npm -g ls | grep -v 'npm@' | awk '/@/ {print $2}' | awk -F@ '{print $1}' | xargs npm -g rm
```
#####Explanation
- ```grep -v 'npm@'``` excludes npm itself
- ```awk '/@/ {print $2}'``` splits all lines containing @ by its default record selector. This takes care of the tree, so only lines like ```abbrev@1.0.3``` remain.
- ```awk -F@ '{print $1}'``` splits ```abbrev@1.0.3``` into ```abbrev``` which is $1 and ```1.0.3`` which we throw away
- ```xargs npm -g rm``` then takes what is lef and removes it
This solution only works under unix. I am very sorry, but this is the only system i have
available. For decent windows input I'd be very happy.