Fixing node/npm ImportError: No module named compiler.ast on Ubuntu 18.04

If you run npm install and encounter this error message:

example.txt
ImportError: No module named compiler.ast

you need to install the python development files using

example.sh
sudo apt install python-dev

Note: In my case, using apt install python3-dev did not solve the issue.


Check out similar posts by category: Linux, NodeJS