Exhibit 5.1

KPMG LLP
PO Box 10426 777 Dunsmuir Street
Vancouver BC V7Y 1K3
Canada
Telephone (604) 691-3000
Fax (604) 691-3031
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
The Board of Directors, Westport Fuel Systems Inc.
We consent to the use of our report dated March 22, 2018, on the consolidated financial statements of Westport Fuel Systems Inc., which comprise the consolidated balance sheets as at December 31, 2017 and December 31, 2016, the consolidated statements of operations and comprehensive income (loss), shareholders’ equity and cash flows for each of the years in the three-year period ended December 31, 2017, and the related notes, comprising a summary of significant accounting policies and other explanatory information (collectively the “consolidated financial statements”), and to the reference to our firm under the heading “Auditors” in the short-form base-shelf prospectus.

Chartered Professional Accountants
February 20, 2019
Vancouver, Canada
KPMG LLP is a Canadian limited liability partnership and a member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative (“KPMG International”), a Swiss entity. KPMG Canada provides services to KPMG LLP.