Skip to main content

Featured post

How to Insert line break in Text component in React Native

Hi, I was developing an application in react native.I have to handle lots of text data in this small react native application.I have used  Text component in react native many times. While working on this application,i had a requirement to display some text content with line breaks.I will explain it clearly with an example.I want to display a text as shown below  Welcome Please subscribe my channel I wrote react native code as shown below <View> <Text> Welcome Please subscribe my channel </Text> <View> When i run these lines of code,It will display text as shown below Welcome Please subscribe my channel   - instead of displaying in two lines with line break,it displays in a single line.So i have to find a solution to insert line break in Text component in React Native.After lots of research,i found a clean solution as shown below <View> <Text> Welcome{"\n"} Please subscribe my channel </Text> <View> Here ...

Error: Cannot find module 'C:\Users\Administrator\use' error in node js using node version manager (nvm) fixed

In this blog post we are discussing 


   1.Node version manager (nvm)

   2.How to list all node js versions installed on the system using nvm

   3.How to fix Cannot find module  error in node js

   4.How to set a specific node js version as default version on the system 


Node version manager (nvm)


Node Version Manager is the tool for install ,manage and uninstall different node js versions on the system.Using nvm we can install different node js versions and switch between different node js versions and uninstall specific node js versions  from Windows,Linux and Mac OS.

if we have different node js projects which uses different node js versions then nvm helps us to switch between required node js versions based on the current project.Without nvm,it is difficult to handle different node js versions in single system.


How to list all node js versions installed on the system using nvm


Using a command we can see all the installed node js versions on the system 


nvm ls




How to fix Cannot find module  error in node js


I got this error when i was switching between different node js  versions installed on my system.I excuted the command 

                 

            node use 14.18.1

Unfortunately i got the error 






node:internal/modules/cjs/loader:1050

  throw err;

  ^


Error: Cannot find module 'C:\Users\Administrator\use'

←[90m    at Module._resolveFilename (node:internal/modules/cjs/loader:1047:15)←[39m

←[90m    at Module._load (node:internal/modules/cjs/loader:893:27)←[39m

←[90m    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m

←[90m    at node:internal/main/run_main_module:23:47←[39m {

  code: ←[32m'MODULE_NOT_FOUND'←[39m,

  requireStack: []

}


Node.js v18.14.0



I could fix module not found error by executing the command properly .The error is fixed by changing node with nvm in the command 


                  nvm use 14.18.1





How to set a specific node js version as default version on the system 

                

Using the below command ,you can set any node js version.In the below example i set node js version 14.18.1 as my currently using version on the system 


 nvm use 14.18.1