How can I specify the package version?

I need to use new version of nodejs. But travis does not used the installed one and always use one of the pre-installed one?

How can I fix this?

[Pre-installed Node.js versionse[

v10.15.0

v11.0.0

v4.9.1

v6.16.0

v8.12.0

v8.15.0

v8.9]

I specified the node js version 10.x in the travis file.But it did not work. And install it with command.
But I always got this error "The engine “node” is incompatible with this module. Expected version “>=10 <11”. Got “8.12.0"”

The language is go. I can only set the golang version from travis file.

I used nvm and it worked. But new issue is after install the node, npm with error not found.
I test it in my machine and it works well. Why this?

can not install with sudo npm.