Ir al contenido principal

Install nvm on macbook m1 for work with node the best way

 On this week I buyed a new macbook pro m1 (thank you BTC for the partner), is a great laptop but is necesary to configure all environment for work with node and is necesary the next:

  • Check the type of the bash
  • Download the file to configure the nvm
  • Check or create file to set environment vars in user folder
  • Check is nvm configure to actual user
  • Download the node




Check the type of the bash

The macbook pro m1 is configure to zsh bash (under macOS Monterrey) , but is probable to show another bash, for check this is necesary execute the next command line in a terminal

echo $SHELL

If the exist is

/bin/zsh

This tutorial is for you, is you not show the text, dont worry, in the official documentation is the step by step to configure all environment for your bash and is here


Download the file to configure the nvm

For download the file config, open a terminal and execute the next command

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash


Check or create file to set enviroment vars  in user folder

In this step we open or create a file with nano (this file is only work with zsh bash)
nano ~/.zshrc

and paste the next code (if the file containt a others vars, write this code to the end of file)

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Reboot your Mac or logout

Check is nvm configure to actual user

Now in a terminal execute:

nvm -v

If you show the version of nvm, congratulations


Download the node

With nvm you have many options to downloads diferents version of node, if you simple execute in a terminal

nvm install node

The nvm install the last version of node, for install a specific version show the documentation, but is very easy to install. You can set the default version of node to work in your macbook, but for default, nvm set the laster version






Comentarios

Entradas populares de este blog

Northwind para Mysql y otras

Supongamos que necesitamos una base de datos para comenzar a hacer pruebas y a la vez necesitamos que esa base de datos contenga mucha información con la cual trabajar. En mis tiempos de universidad existía una base de datos que utilizábamos en los laboratorios con SQL Server y c# para mostrar los datos en algún formulario. El nombre era Northwind. El problema es que era solo para SQL Server, pero alguien en se dio a la tarea de exportar esa base de datos a MySql y es justo lo que te vengo a mostrar acá. Hace un tiempo atrás clone de los repositorios de Google Code   esa información (que como algunos de ustedes sabrá dejara de estar al servicio de todos en un tiempo). Modifique un poco la DB de Mysql para que se pudiera ejecutar el script sin ningún problema. Lo interesante de todo esto es que puedes utilizar los demás script para diferentes gestores de base de datos Se advierte que para poder usarlas adecuadamente hay que modificar los campos de tipo longblob y qu...

How to upload File from form data POST in Android with Retrofit 2

 The last day I explain how to upload a simple CSV file using node . And now I teach how to upload from android device. Get source code here:  GitHub This article is write in java... later I'll add the method for kotlin. The logic is not changed, only the format code. 1) Is necessary add the dependencies in gradle: module implementation 'com.google.code.gson:gson:2.8.6' // RETROFIT // implementation 'com.squareup.retrofit2:retrofit:2.6.2' implementation 'com.squareup.retrofit2:converter-gson:2.6.2' implementation 'com.squareup.retrofit2:converter-scalars:2.5.0' 2) Add permissions in AndroidManifest.xml and modified the application for work with network security policy <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> in applitacion add ...

Instalacion de apk desde el adb (Linux y Windows)

Por lo general siempre instalamos nuestras aplicaciones por medio de algún gestor oh tienda de aplicaciones como el Google Play oh F-Droid por mencionar a algunos. Pero que pasa cuando no podemos acceder a esas tiendas y hemos modificado algunas cosas del sistema como por ejemplo la eliminación del teclado, por el simple hecho de que no nos gusta, oh a ver quitado el propio launcher del sistema, aunque suene ilógico hay personas que lo hacen (yo por ejemplo lo he hecho a modo de prueba en un Kiosera que tuve, ya que me pareció demasiado pesado y lelo el launcher y el teclado por defecto y llegue a una optimizacion del SO de un 100%). Quizás eso es lo mejor de Android, el completo control que este te da si eres root, sin mas preámbulo te muestro como instalar las apk por medio del ADB de Android. Pero antes de que los vea me gustaría aclarar que esto es aplicable tanto para dispositivos físicos como emuladores, en el caso de ser dispositivos físicos asegúrate de tener los dr...