Answered by ZUPAN | May. 11, 2019 01:43
Actually, it is nationality (citizenship) that matters and not the country where you are right now or where you live. Just the passport regardless of your status in any particular country. Of course, beside the citizenship, the second detail is your itinerary that has to be eligible.
Your planned itinerary is fine because everything that interests Chinese immigration authorities is the fact that you will arrive in China from one and leave it (China) to some other country. So, Nepal - China - France is just fine for 144 hours visa free travel. Your actual visit to Shanghai, probably on visa, has nothing to do what will you do in the (near) future regarding this 144 hours visa free rule. By the way, you should know that your both flights, Nepal - Shanghai and Shanghai - France should not have any additional landings within mainland China beside, of course, Shanghai.