node.js - How can I install an NPM package for a different user? -
i'm writing chef script provision windows 7 build machine our environment. 1 of our dependencies npm package needs installed on 2 separate user accounts. however, npm packages on windows installed locally user. know command can execute install npm package second user while logged in first user?
short answer: copy , paste package. simple!
long answer: there 1 prerequisite: must able copy , paste necessary files must be. in case, either have administrative privileges (in case carry out method 1) or can log in both user accounts (in case carry out method 2). assume standard windows deployment scenario, make template machine image template profiles , duplicate other machines.
method 1
- install node.js (run installer, e.g. node-v0.12.7-x64.msi)
- run "node.js command prompt" start menu
- order installation of first package following command:
npm install -g [package name]
...where [package name] name of package. verify installation successful. (important) - repeat step 3 install additional packages.
- enter following commands:
cd %appdata% explorer .
please verify in folder path similar "c:\users[your username]\appdata\roaming\" "[your username]" name of user account. ("c:\" portion might different.) - locate 2 folders called
npm
,npmcache
- copy these 2 folders target users' profiles. target folders must have same path 1 introduced in step 5, instead of "[your username]", usernames.
you must either have administrative privileges carry out step 7.
method 2 same method 1, before carrying out step 3, log in first user should receive package. carry out steps 3 , 4 only. once installation successful, log out , log in next user. repeat steps 3 , 4.
you can mix , match too. e.g., carry out method 2, have admin copy files second user highlighted in step 5 through 7 of method 1.
Comments
Post a Comment