I'm an engineer who has worked at non-profits for several years and have maintained top skills. The answer is- your long term earnings will absolutely be reduced, though not for the already cited reasons.
Essential books to read before going into the non-profit space:
* With Charity For All - Ken Stern
* Doing Good Better - Bill MacAskill
Also, read SSIR, it has the best coverage of emerging trends in the non-profit space:
http://ssir.org/
The short answer is- if income is important to you, marginally to significantly more important than impact, DO NOT work for a non-profit. If impact is of marginal to secondary importance, then contribute money and time in accordance with the emerging analytics that Bill MacAskill talks about.
If impact is most important, and income is not, then by all means work for a non-profit, but remember that mission comes first, second, third and fourth.
==
There are very, very few non-profits that are using technology in any of the ways that resemble tech-focused big shops or startups, because at this stage there are very, very few non-profits whose funding streams are dependent on specific details of technology deployment.
There are (to my eyes) huge opportunities for technical innovations like data analytics, APIification, and many others to transform the non-profit space, but these transformations will be years in the making. The space moves very, very slowly.
So, at a non-profit, you may maintain skills, and you can often be paid a fairly equivalent salary, but all sorts of other income, practice, and leadership opportunities will pass you by.
* bonus
* equity
* quantitative management
* developing for the customer
* etc
Once you have more of your life-course settled, with life partners and kids and living situation and so forth- by all means go work for a non-profit.
I DO NOT recommend it for junior engineers.