Category: Linux/ubuntu

npm start fails ( Error: listen EADDRINUSE :::3000 )

I deployed my MEAN project on ubuntu. Very often I got the message showing that the port 3000 was in use.

I use the following command to find the pid occupying the port 3000.

sudo netstat -peanut | grep 3000 | awk ‘{ print $9 }’ | sed ‘s:/[^/]*$::’ | grep -Eo ‘[0-9]{1,5}’

In my case, the pid returned is 4532

Then I terminate the process using the command kill.

kill 4532

Finally, npm start succeeds.

Install pinyin into ubuntu 16.04

  1. Go to System Settings–> Language Support–> Install/Remove Languages, select Chinese(Simplified)
  2. Open the terminal and install the IBus framework with following command:

    sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4

  3. Start the IBus framework. In terminal input:

    im-config -s ibus

  4. Install the Pinyin engine

    sudo apt-get install ibus-pinyin

  5. Restart IBus daemon

    ibus restart

  6. Setting the IBus

    ibus-setup

    In the popup window, switch to Input Method tab,click the Add button to choose the Chinese input method installed just now.

  7. Go to the Text Entry (from the right-top corner of the window or from the System Settings -> Text Entry) for the shortcut of input method exchange.

Side note: I came across the following error in this step:

Failed to download package files Check your Internet connection.

For solving it, I did the following:
Press Alt+F2 and type software-properties-gtk.
Change the download location to Main Server or another server close to the country you live in (in my case, it’s already server for Canada by default, so I changed it to Main Server) and do the first step again. Succeed!

After trying above method, I found the chinese input is different from what I get used to use. I decided to install google pinyin. The steps are as follows:

sudo apt-get install fcitx-googlepinyin
im-config

In the windows, click “OK”, then “Yes”, and select fcitx. Click “OK” to confirm and then “OK” to exit.

Now log-out and log-in back. You should see a Keyboard on the top right corner (the task bar of ubuntu in the top).

Click on it you’ll see from the drop-down menu an option ConfigureFcitx . Click on it opening up a panel, where in the Input Method, click the little + button in the bottom to add the method you like. After exploring a bit, I found Sunpinyin is more comfortable for me.

For more details, refer to this post from askubuntu.