The three-time champion retired at the end of the second set with Del Potro leading 7-6 (7-3) 6-2 on Arthur Ashe.
“I will keep going. That is all,” Nadal said in a post-match press conference.
“These moments are tough but I have to keep going and working hard to get more opportunities.”
Nadal has reached four Grand Slam finals in the last two years – winning the US Open in 2017 and back-to-back French Open titles in 2017 and 2018.
The 17-time Grand Slam champion also reached the quarter-finals of the Australian Open this year, as well as the semi-finals at Wimbledon.
“I am having two great years so I just have to enjoy the moments. This year has been fantastic until this moment,” he added.
“I am playing the right way and enjoying things. I am having success at the age of 32. A lot of people in this room, including me, didn’t think I would be at this level at this age.
“I still have a passion for the game so I will keep fighting and working hard.”
Nadal, who will also miss Spain’s Davis Cup semi-final against France next weekend, said he “hated retiring” but was in “too much pain” to continue the defence of his US Open title.
The Spaniard has suffered from tendonitis in his knee in the past and spent eight months away from tennis between 2012 and 2013.
He missed around three months in 2014 and 2016 because of difficulties with wrist injuries and appendicitis.
“All my career everybody said that because of my style, I will have a short career,” he added. “But I’m still here.”
The world number one doesn’t expect to be out for long and claims his team are “experienced” at dealing with his knee injuries.
“I cannot compare the knee with other times as the pain is always very similar. This time it was a little bit more aggressive with my movement,” said Nadal.
“I don’t know what can happen in a couple of days or a couple of weeks. Mentally it is much worse. I know what I have. It is a similar thing to always so it is about good treatment.
“It is not an injury that tells you, ‘three weeks off, you are back. Six months off you are back.’ I know what I have to do to be better as soon as possible. I am sure it will not be six months off of course, I was just making a comparison.”