使用npm install作为MS-Windows系统帐户

我有一个节点应用程序运行在Windows上,我想能够自动更新。 当我运行npm install -d作为Administrator帐户 – 它工作正常,但是当我试图通过我的自动化软件(即作为local system运行)运行它时,我遇到错误,当我尝试从私人安装专用模块git存储库:

  npm ERR! git clone [email protected]:team/repository.git fatal: Could not change back to 'C:/Windows/system32/config/systemprofile/AppData/Roaming/npm-cache/_git-remotes/git-bitbucket-org-team-repository-git-06356f5b': No such file or directory npm ERR! Error: Command failed: fatal: Could not change back to 'C:/Windows/system32/config/systemprofile/AppData/Roaming/npm-cache/_git-remotes/git-bitbucket-org-team-repository-git-06356f5b': No such file or directory npm ERR! npm ERR! at ChildProcess.exithandler (child_process.js:637:15) npm ERR! at ChildProcess.EventEmitter.emit (events.js:98:17) npm ERR! at maybeClose (child_process.js:735:16) npm ERR! at Socket.<anonymous> (child_process.js:948:11) npm ERR! at Socket.EventEmitter.emit (events.js:95:17) npm ERR! at Pipe.close (net.js:451:12) npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <[email protected]> npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d" npm ERR! cwd D:\nodeapp npm ERR! node -v v0.10.8 npm ERR! npm -v 1.2.23 npm ERR! code 128 

只要使用相同的系统运行git克隆工作正常。 有任何想法吗?

更新:这是_git_remotes目录的权限:

 > get-acl C:\Windows\system32\config\systemprofile\AppData\Roaming\npm-cache\_git-remotes |Format-list Path : Microsoft.PowerShell.Core\FileSystem::C:\Windows\system32\config\systemprofile\AppData\Roaming\npm-cache\_git-remotes Owner : BUILTIN\Administrators Group : NT AUTHORITY\SYSTEM Access : NT AUTHORITY\SYSTEM Allow FullControl BUILTIN\Administrators Allow FullControl Audit : Sddl : O:BAG:SYD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA) 

不要将自动化软件作为local system 。 相反,创build一个新的专用服务帐户(如果需要,pipe理员级别)。 你也可以这样做,这个账户只能从这个系统login而不能远程login。 我会尝试运行该软件作为非pipe理员第一。