1

I was given an admin access that may be taken away from me anytime soon, and I am trying to gather as many resources as I can to get by without it when it's gone. I installed all the essentials (express, mongoose, body-parser etc) as global installation and they live in my AppData/Roaming folder in its own node_modules folder. will I be able to use those modules in the future without admin access?

3
  • @ Lee Brindley, nothing bad happened yet. I was just wondering if I would be able to install the globally installed versions of the modules from their global location into nodejs projects I will do in the future.
    – SAR
    Jun 7, 2019 at 20:13
  • 1
    @ Lee Brindley, the word "if" is exactly my question- will I be able to install the packages from their global location in AppData directory into future projects w/o admin privilege.
    – SAR
    Jun 7, 2019 at 20:43
  • @SAR would this link help? Jun 7, 2019 at 21:47

2 Answers 2

0

If you are following best practices you should have no application dependencies installed globally. Your dependencies should be local to the project using them. However, even if you are using global dependencies, they install into your user folder which you would not lose access to even if you are not administrator.

3
  • Thanks, @Deadron, will I be able to "re-install" them from the user folder into a project folder with npm without admin access?
    – SAR
    Jun 8, 2019 at 0:42
  • Yes you should never lose access to your user folder.
    – Deadron
    Jun 8, 2019 at 0:51
  • Thanks! I hope I won't have any trouble with this.
    – SAR
    Jun 8, 2019 at 17:50
0

Try unpacking the binary package of node.js into a folder (no-installer and no-admin-privileges). It appears node.js now already includes npm, with the following default structure:

{Parent}
  |-- \node_modules
  |     |-- \npm
  |     |-- \corepack
  |-- \node.exe
  |-- \npm.cmd

The location of folder to store node modules is a configuration flag prefix to set as global or per package storage take a look at config documentation (npmjs.com)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.