Featured post
- Get link
- X
- Other Apps
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
Popular Posts
How to Check React Version Installed in Your System by Checking PACKAGE.JSON File and Executing Command from COMMAND PROMPT
- Get link
- X
- Other Apps
Execution failed for task ':react-native-reanimated:externalNativeBuildDebug' solved
- Get link
- X
- Other Apps
Error: Invalid `prisma.$executeRaw()` invocation: fixed using log: ["query"] option
- Get link
- X
- Other Apps
ERROR Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined
- Get link
- X
- Other Apps
app keeps stopping error solved in android studio emulator using logcat in react native project
- Get link
- X
- Other Apps