
The “Error: Cannot find module” appears when you try to open the Discord app. It prevents the gamers from using the VoIP services and joining the servers. Try to fix this problem at the earliest possible to access this messaging platform.
But, do you know what causes the Discord Javascript error: cannot find module? It usually occurs due to app misconfiguration. Sometimes, a corrupted Discord app could generate this problem, and a faulty app installation could trigger this Javascript error in Discord.
Moreover, corrupted system files could prevent you from using the application. An antivirus program might cause issues accessing Discord from an unsecured browser. Use a reliable web browser and use this digital platform without hassle.
What Causes Discord Javascript Error Cannot Find Module?
Several reasons could trigger this Javascript error in the Discord app. The Windows firewall could restrict you from opening this streaming service, and discord users can face the problem of incorrect app settings. Reconfigure the settings to fix the “Discord Javascript error cannot find the module”.
This error message might appear if “pnpm” is enabled for the Discord project. And, you can also face this problem when using a corrupted Discord app. Sometimes the temporary Discord files could block you from restarting the app. Remove them from the Windows 10/11 device to use Discord without further issues.
4 Solutions to Resolve Discord Javascript Error cannot find Module
There are many ways to solve this Javascript error from Discord. But, you should first try to restart the device and open this messaging app. Something is wrong with the Discord setup files if that doesn’t work. Find the problematic files and remove them from the device immediately.
Failed to identify the corrupted Discord installation files? Implement the following solutions to overcome this complicated Javascript error from the app:
Run the app without Administrator Privileges
Discord shows the “Javascript error: cannot find module” when using it as an administrator. Ensure not to login into the administrator account to fix the error. And, you should never run a program as an administrator unless it’s required. Otherwise, you might get this error message while opening the app.
Many users reported that running the app without administrator permissions resolves the problem. And, whenever you try to run it as an administrator, the “cannot find module” issue might occur. Thus, open the Windows device, and locate the Discord icon from the desktop.
Right-click on it, choose “Properties”, and move towards “Compatibility”. Can you see the Run compatibility troubleshooter option? Select that and navigate to the “Settings” section afterwards.
Look for running this program as an administrator and remove the tick from its checkbox. Click “Ok” and tap on “Apply to save the Discord app permission changes.
Discord will now run without administrative permissions. After a few minutes, restart the PC and double-tap the Discord app to open it. Try to join the servers and check if Discord shows this Javascript error message. Apply the next solution if Discord cannot find the module error persists.
Delete the Discord folders from AppData and Local AppData
Removing the folders containing Discord’s configuration files restores its settings. And, it also resolves this Javascript issue that is preventing Discord from running. You can find the AppData and Local Appdata folders in File Explorer.
Go to the Windows taskbar, tap on “File Explorer”, and select “View”. Head towards the “Hidden Items” section to get the hidden Discord files. Then, move to the location bar and write “C:\Users\YOURUSERNAME\AppData\Discord”.
Find Discord from the AppData folder, right-click on it and choose “Delete”. Close the AppData window once done and open the Start menu. Select “Run” from the built-in Windows tool list. Write “%localappdata% in the Run box, and hit the Enter key afterwards.
Go to the location bar when the Local window appears. Write “Discord” to get the app’s configuration and temporary files. Right-click on them, and opt for the “Delete” option when the pop-up menu appears. Reboot the device and open Discord without getting any Javascript error.
Close all the Discord Processes
Discord fails to work properly when any parallel processes run in the background. Stop all these unwanted programs to eliminate the “Javascript error: cannot find module”. And, you can do that using the Task Manager tool.
Press the Windows and X keys simultaneously, and choose “Task Manager” from the pop-up menu. Navigate to “Processes”, and find Discord from the app list. Right-click on it and choose “End Process” to close all the Discord processes.
Restart the Windows device and try to open Discord from the web browser. Did you get the “Javascript error: cannot find module error message? Use the Command Prompt tool to close the Discord processes without issues.
Press the Windows and R keys together, and write “cmd” when the Run box opens. Hit the Enter button to get access to the Command Prompt program. Write “taskkill/f/im discord.exe” and press the Enter key. Wait for at least 2-3 minutes, and then open the Discord app without getting the Javascript error.
Enable Pnpm on Discord
Discord users should enable “pnpm” to fix this Discord error. Open the app, go to the project page and right-click on it to choose “Properties”. Tap on “Discord Rich Presence” and head towards the “Display” section. Write the project name and write the “enable-pnpm” command line.
Restart the device, and try to open the Discord app. Enter “npm install” in the command box if the error persists. Write “require ()” instead if that doesn’t fix this Discord Javascript error. Additionally, you can delete the “node_modules” folder and “package-lock.json” file. Re-install them after a few minutes using the npm install command.
And, Lastly, Uninstall and Reinstall Discord
Failed to fix the Discord Javascript error cannot find modules? Uninstall the app from the Control Panel. Go to the Apps & Features section to locate Discord, and right-click on it. Choose “Uninstall”, and after that, restart the Windows 10/11 device.
Open a web browser and write “Discord” in the address bar. Access Discord’s website, click on the download link and select the OS. Discord might take at least 4-5 minutes to complete the installation process.
It might take more than that if there is an unstable Wi-Fi connection. When the “download is complete” message appears, double-tap the app. You can now open it without the Javascript error: cannot find module error. Contact an expert to get more effective solutions to fix this Discord glitch.