I tried to use version 6.9.5 of node.js and encountered problems with the Grunt scripts; I uninstalled the version and installed the newest 4.xx version. Now the Grunt scripts are running correctly
Yes, that's correct. We'll improve the current recommendation to make it clear:
Install Node.js 4 LTS or newer
It means newer compastible with 4 LTS. You should use as recent "x.y.z" as possible to get security or other bug fixes, which have been released. However, from the three numbers, if the first one (major version number) changes, it means breaking change in the product. That's why should update "z" eagerly, and "y" with hope, that some workarounds or performance would improve. You could try updating to a higher "x" version, but you would have to test, if it works, becauuse major version number increasing means breaking changes, which may affect your usage scenarios. As you found, going from "4" to "6" breaks some build tools (NPM modules) used to build a CS UI extension.
You can read more about Semantic Versioning, which is used in the Node.js ecosystem.
If you are in a situation where you are needing to support multiple versions of node in your development environment you can also use tools like nodist and install multiple versions of node (https://github.com/marcelklehr/nodist) on your dev box.
On Windows, you may need to uninstall node.js using appwiz.cpl rather than trying to use npm to downgrade. The latest 4.x release can be found for download here: https://nodejs.org/dist/latest-v4.x/
Hi Aidan,
The point of using something like nodist (there are also others like https://github.com/jasongin/nvs) is that it will allow switching both node and npm versions (so no uninstalling required)
Regards,
Matthew Barben
For those who are starting off in Smart UI today, is the recommendation still NodeJS 4.x.y (latest appears to be 4.8.3) as opposed to the currently shipping LTS (latest stable) which is 6.10.3? You kind of have to dig for anything earlier than the LTS release.
-Hugh
The statement about using Node.js 4.x.y only is still valid.
Node.js 4 is a LTS version, which will be supported till April 2018. The active mode has ended last month and the maintenance mode has begun - only critical bugfixes will be checked in. So, we are still not so bad here. Remember, that we use Node.js only to build the output module bundles; we do not run productive code in it.
Node.js 6 is the most recent LTS version, which is currently in the active mode. We had problems with both 3rd-party NPM module and with our Grunt tasks there. You will not be able to use the most recent CS UI SDK with it.
See also Node.js release schedule at https://github.com/nodejs/LTS.
We gave the upgrade to Node.js 6 another chance last month and were successful. We needed both upgrading 3rd-party NPM modules and fixing our Grunt tasks. The same environment could be used with both Node.js 4 and 6 versions (both latest).
I believe, that it will be released with the September update. I am not sure, if this would get approved for the June update, because we are in the last phase of the project.
I do not know, if you should want to try the upgrade and do fixes and workarounds yourself, before we officially release it. Do you have a need to run other tools together with the CS UI SDK, which require Node.js 6? I have successfully used both n and nvm Node.js version managers for quite long for different projects. The key is to avoid global NPM modules :-)
Yes, if you want to use Node.js version manager like nodist on Windows, you must not install mutliple Node.js versions. You must not install multiple Node.js versions anyway - at least together with Node.js 4. I do not know, if Node.js 6 supports it, bei it by upgrade or side-by-side. (I doubt it.)
With Node version 8 going LTS yesterday. This means that Node 4 is in maintenance mode until April 2018 - are there any plans to upgrade the build tools to allow them to run on newer versions of node?