#Node js windows cannot find module install
It is useful, for example, then node app is converting local files, like less - if you install it globally you can use it in any directory. -g is not a way to install global libraries, it's only a way to place them on system path so you can call them from command line without writing the full path to them.I'm pretty much new to node.js myself so I can be not entirely right but from my experience it's works this way:
![node js windows cannot find module node js windows cannot find module](https://programmerah.com/wp-content/uploads/2021/03/20181127150937216.png)
When you want to use globally installed modules' binaries in your CLI you need to add it also to your PATH, but without node_modules part (for example %AppData%\npm in Windows 7/8/10). It's worth to mention that NODE_PATH is only used when importing modules in Node apps. Setx NODE_PATH %AppData%\npm\node_modules \nodemodules pm\nodemodules and rm -r node-gyp. Open PowerShell as an administrator, cd to the install directory of Node (probably either C:\Program Files (x86)\nodejs or C:\Program Files\nodejs ). Quick solution in Windows 7+ is to just run: rem for future This is can be fixed in two easy steps (tm): Nuke node-gyp from orbit just in case of corruption or something.
![node js windows cannot find module node js windows cannot find module](https://i.ytimg.com/vi/-fKNSJTZI08/maxresdefault.jpg)
To be done with it once and for all, add this as a System variable in the Advanced tab of the System Properties dialog (run control.exe sysdm.cpl,System,3). Add an environment variable called NODE_PATH and set it to %USERPROFILE%\Application Data\npm\node_modules (Windows XP), %AppData%\npm\node_modules (Windows 7/8/10), or wherever npm ends up installing the modules on your Windows flavor.