In this way, you can run multiple react applications at the same time on the same computer, and each application uses different versions of the Node.js environment. Similarly, you can create multiple different aliases, each alias can point to different versions of Node.js. you can use it nvm use Command switch to this version: This will create a name called myapp Alias, pointing 14.16.1 Version of node.js. Use the following command to create custom alias: You can use NVM to create a custom alias (Alias) to specify your favorite name for each environment. If you want to use the same version of Node.js in other terminal sessions, you need to use the `nvm user` command to switch the version again.Ĭan you name the different environments of NVM yourself? This will be switched to the Node.js version specified in the current terminal session and starts the React application. Then enter the project root directory in the terminal, use the `nvm user` command to switch to the specified version of the node.js, and then use the` npm start` command to start the React application, such as:: Of course, you can also use aliases in it nvmrc File, and specify the required Node.js version in the file, such as: When using different versions of Node.js to run React applications, you need to create a. This will switch the default node.js version to 14.17.6. If you want to permanently switch to a node.js of a certain version of the current terminal session, you can use it nvm alias Command, for example: This will switch the current node.js version to 10.24.1. You can find the installation instructions in the GitHub warehouse of NVM and install according to your operating system and needs.Īfter installing NVM, you can use it nvm install Order to install multiple Node.js versions, for example::Īfter installing multiple node.js versions, you can use it nvm use Command to switch to use different versions of node.js, for example: To use NVM to manage different versions of node.js, you can follow the steps below: How to use NVM to manage different versions of node.js, and then use different node.js versions to run different versions of React applications?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |