NVM commands are not evaluated


#1

Hi,
We tried to configure our projects using node but we have strange errors: 'Promise is not recognised in node. The node versions is still 0.10.33 even if we set it up to v0.12.7 or v5.X using nvm.
It seems that the nvm commands we execute are not taken in account.
We don’t use the .yml file, only the commands from the CircleCI interface, maybe the error is related to that…
We are trying to move from Codeship to use your service so we really appreciate your help !


#2

Hi there,

Where are your nvm commands being specified? The best place to specify them is Project settings > Test Commands > Dependency Commands > Pre-dependency commands.

If you’ve already done this, I think the problem is probably related to the fact that every build step we run works in a separate shell. This means that running nvm use 5.0 won’t have any effect on subsequent build commands. The best way to change node versions with nvm is to use this command:

nvm use <version> && nvm alias default <version>

By running nvm alias default <version>, you ensure that every new shell will use the node version you specified.

Hope this helps!

-Frank


#3

Thanks for your explanation and the solution @frank.
It works :slight_smile:


#4