Node.js / npm commands
by Yury
JavaScript
//Listing globally installed NPM packages and version
npm list -g --depth=0
//sabma config
sudo nano /etc/samba/smb.conf
//samba restart
sudo service smbd restart
//ubuntu: open samba ports
sudo ufw allow Samba
//ubuntu open port (http://help.ubuntu.ru/wiki/%D1%80%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE_%D0%BF%D0%BE_ubuntu_server/%D0%B1%D0%B5%D0%B7%D0%BE%D0%BF%D0%B0%D1%81%D0%BD%D0%BE%D1%81%D1%82%D1%8C/firewall)
sudo ufw allow 8080
/** FIX FOR: events.js:72 throw er; // Unhandled 'error' event **/
// stackoverflow.com/questions/16827987/expressjs-throw-er-unhandled-error-event
// kill another node *app*.js instance for same port running:
/* If you want to find and kill process, follow these steps: */
ps aux | grep node
Find the process ID (second from the left):
kill -9 PRCOCESS_ID
/* 2 See if you have the */ killall /* command, much less typing */
/* 3 */ ps aux | grep node | awk '{print $2}' | xargs kill -9
//***********//
//files/folders listing (-1 = per-line, -Al = with system hiddens)
ls -1 -Al
//To upgradenpm, run:
[sudo] npm install npm@latest -g
---
//As you can see on StackOverflow, people are looking for a way to uninstall all node modules in one shot. My reasoning for doing so is that the NTFS (Windows) file system has issues removing directories where the path name is longer than some character limit. For some reason, the npm uninstall command works, regardless of this limitation.
//My solution has been to run:
npm uninstall `ls -1 node_modules | tr '/\n' ' '`
//But it'd be great if npm came with an --all flag out of the box, so you could simply run:
npm uninstall --all
_____________________________________________________________________________________
bitnami@linux:~/nodejs$ sudo nano /etc/samba/smb.conf
GNU nano 2.2.6 File: /etc/samba/smb.conf
map archive = no
create mask = 0777
directory mask = 0777
[home-bitnami]
browseable = yes
comment = home...