EmberJS development on a machine with outdated node version - node.js

I have a project where I want to use the latest EmberJS to develop under. Currently, node 0.10.4 is installed on the machine I was given, which is a hard requirement for a backend system that I will need. Since the nodejs is so outdated, I cannot install the latest Ember on this machine without updating the NodeJs. My ember app has to communicate to the backend system through socket.io, is it possible to create a virtual development environment on this machine to develop Ember with the latest nodejs and also be able to easily configure the socket.io connection during development?
I believe once Ember is compiled down to distribution files, I can easily migrate these files into the public folder of my outdated nodejs with no problem, but correct me if I'm wrong
Any ideas on a solution that is easy to configure without asking for a new machine?

The easiest way to handle this situation is to use Node Version Manager (NVM).
Just follow the install instructions located here.
Then you can simply type nvm install <desired version of node>.
For example, when developing your backend system, first type nvm install v0.10.4. And when developing your Ember app, type nvm install v6.0.0.
(Note: to find out what versions of node are available to download, run nvm ls-remote).

If you use Linux - you can do following steps:
create new user
download archive with latest node.js version from here:
extract archive to any folder in new user /home directory
then switch to created user and do echo "export PATH=$PATH:/path/to/your/latest/node/bin/node" >> ~/.bashrc;
Then you should be available to use node.js 7.*.* only for this user, but default version for other users will be 0.10.4

Related

Install mongo by CLI and for a project only inside project directory

Is there a way to install MongoDB only inside a directory through some sort of a script?
An idea is to use it as a dependency in a node.js project. After npm install on the project, npn would download mongo binaries, and install them into project's folder. Later this binaries could be accessible from node.js script which would control them like start the database. This should run on standard platforms (Win, Linux, Unix) and should be hidden from user.
I found a way for unattended install. But this would be installed for whole system and I'm not sure what changes It'll make to windows. Also this is platform dependent solution. I'd welcome some sort of unified node, like npm package.
This runs MongoDB servers, and is used for driver testing.
You'd need to download the binary which you could do via m. You could also do this by hand.

Angular - How can I specify a different node.js version than what is installed on the system?

System: CENTOS7
I'm working on our TEST system that has a version of node prior to 8.9.
The application which I'm working on uses node 8.9.
The application runs fine when deployed out to Tomcat.
The issue is that I'm unable to just run 'ng serve' because the system sees v6.x.x.
Is there a way that I can modify my project to see the packaged node v8.x so I can run the ng options?
I'm instructed to not modify the system settings.
UPDATE
Just so others know what I ended up doing was modifying my bash script to include in the PATH ./node_modules to where node was in the local project. This is always the same path for whatever project and its version on node.
I did that for a while until a few months ago when we finally had rights to do things differently and are now using Node Version Manager
Install nvm (node version manager) to centOS
Then you will can install many version of node in your system
In this case you have to alias default version of node in nvm setting with version you want

Sharepoint Workbench : This site can provide a secure connection

I've created a webpart.
I'm using a Node.js, with npm, Yeoman and Gulp.
I installed a certificate with gulp trust-dev-cert, and I have this error on my page "This site can provide a secure connection", and the app isn't accessible.
This is my package.json
My node version is 8.9.1.
I tried to change the NODE_NO_HTTP2=1 environment variable , like this tutorial , but it doesn't work.
Do you have any idea to resolve my certificate problem ?
Thank you very much
Not sure why it isn't working after NODE_NO_HTTP2=1 changes.
I would suggest that you uninstall the current Node.js installation and reinstall the Node.js with the previous LTS version.
The previous Node.js version is v 6.12.
You can download it and install it on your machine and then run the gulp commands.
Link - Node.js v6.12.0
As mentioned here, currently only Node v6 is supported in SPFx

how come I have so many versions of nodejs?

how come I have so many versions of nodejs.
I have multiple of command prompts applications, I have
1. nodejs cmd
2. ubunto bash cmd
3. my normal cmd
and a bunch of others but I dont use them..
my question is.
1.how do I update my nodejs in my system and be just automatically reflected on all of my cmd's? is that even possible?
2. why is this happening?
3. what cmd should I use for running node applications?
below are the snapshots of cmds and the result that it gave me when I checked the version of node.
Right off the bat, I can tell you that the only nodejs package actually installed globally on your system is the first image you have shown (v6.10.2).
The second image (v6.11.2) came with the nodejs installer. So if you uninstall that application, you will not see it again. Check your PATH variable to make sure.
The third image (v4.2.6) is installed on WSL and therefore lives some place separate from the rest of your windows files and programs. You can use the command apt-get remove --purge nodejs to remove that one.
To answer your question, you cannot have the same nodejs across all systems because as you can see from my answer above, these versions of nodejs live in separate environments which are contained.
I would recommend using the nodejs installation from nodejs.org for running nodejs. This is the same as your second image.
Did you know windows has a package manager? Try chocolatey for managing node versions.
how do I update my nodejs in my system and be just automatically reflected on all of my cmd's?
why is this happening?
You can install node.js globally, you have different versions because you didn't install globally, so your cmds can't be automatically reflected. You can see this blog how to install node.js globally:
How To Install Node.js on Ubuntu 16.04
what cmd should I use for running node applications?
you can run node applications using cmd which you want, it doesn't matter.
You can use nvm to manage and easily switch between node's versions.

Is it possible to locally run multiple apps that run on different node versions at the same time?

Example:
I have a web app that runs v6.3.1 node and an api that runs v0.10.40
If I run both the web app and api under one version, one of the apps would break.
If I am developing both apps locally at the same time, I need my environment to be able to run both apps locally each using a different version of node. Is there any tool(s) that would help me do this?
I think you should install nvm for managing all the versions of node you need.
After you install nvm you can get all the node versions you need and then you can open different terminals and choose the version you want for each app using nvm use v6.3.1 or nvm use v0.10.40.
GitHub for nvm can be found here: https://github.com/creationix/nvm/blob/master/README.markdown

Resources