Fix Global Installs Not Working | "Cannot find module" error FIX

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what's up my name is technobe here for troubleshooting welcome back to another quick video in this video i'll be showing you how you can fix global modules and things like that not installing properly with node if you've ever tried to install something with node to use it all around your computer odds are things sometimes work things sometimes don't if you run something like npm install package name hyphen g it'll install globally on your computer you won't have a node modules folder inside of the projects folder and you'll be able to access it anyway through the use of the command line node followed by the package name and whatever other commands you have to put in there usually you use pip for something like python and that just works off for the bad but using global packages in node isn't always the most smooth as when you try and run them you may get a cannot find module error followed by a whole bunch of stack trays there's a really simple way of fixing this on windows head start type in path and we'll be opening up edit the system environment variables inside of this new window that pops up over here click environment variables on the advanced tab of system properties and we'll see this inside of here you'll simply need to look for node underscore path under either user variables or system variables where it shared with other users as well as you can see i already have this set on zone you won't have this at all all you need to do is look in the description down below and click the new button here for the variable name we'll be putting in node path and the variable value we'll be putting in c uses your username appdata roaming npm modules you can point this to a couple of other locations wherever you'd like to install node modules too but you should definitely have them here this is by far the simplest place that you can have them upon clicking ok ok ok once again and closing out of any command prompt windows and programs that could be using it restarting them they'll grab new variables from windows and the next time you try to npm install something globally it'll work properly just like it does before but this time when you try and actually use them you'll be able to use them anywhere on your computer at any time you'll no longer get the cannot find a module error it's nice and simple if you're still getting the error at this point it may be because of something else maybe a configuration error with the package or the package that you're currently working on check the package json file etc etc but anyways you came to this video to find out how to fix global installs not working properly and that's exactly what i've done thank you for watching my name's mean tech nobody here for troubleshoot and i'll see you all next time ciao you
Info
Channel: TroubleChute
Views: 35,588
Rating: undefined out of 5
Keywords: cannot find module, cannot find module nodejs, cannot find module node ensure, node cannot find global module, nodejs cannot find module local file, cannot find module error, cannot find module local file, cannot find module routes, error: cannot find module, cannot find module relative path, error cannot find module discord, npm error cannot find module auth js, error: cannot find module 'bcrypt', npm install global cannot find module, cannot find module 'webpack-dev-server'
Id: xJuk4h1S6wc
Channel Id: undefined
Length: 2min 37sec (157 seconds)
Published: Mon Oct 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.