title: VS Code: Module did not self register (node-expat)
body: <p>I have upgraded my version of Nodejs and npm, and after doing this I'm receiving the following error when running my nodejs application:</p>
  
  <p><a href="https://i.stack.imgur.com/x4fkc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x4fkc.png" alt="enter image description here"></a></p>
  
  <p>I saw a tons of post regarding this issue, and I tried everything exposed there like these ones: </p>
  
  <p>1) <a href="https://stackoverflow.com/questions/28486891/uncaught-error-module-did-not-self-register">Uncaught Error: Module did not self-register</a></p>
  
  <p>2) <a href="https://github.com/Automattic/node-canvas/issues/433" rel="nofollow noreferrer">Error: Module did not self-register" running first example of main github page (Node 0.11.13)</a></p>
  
  <p>By executing a "<strong>npm rebuid</strong>" I see the following output in console:</p>
  
  <p><a href="https://i.stack.imgur.com/ZQEMa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZQEMa.png" alt="enter image description here"></a></p>
  
  <p>As my understanding, seems to be a problem with the "<strong>node-expat</strong>" module, which I suspect that is coming from "xml2json" library. Any thougts?</p>
  
  <hr>
  
  <p>EDIT 1:</p>
  
  <p>I tried to do a re-install of node-expat, by running "<strong>npm install node-expat</strong>" as ADMINISTRATOR, and by looking at the log I see the following:</p>
  
  <pre><code>48 warn kissArteNode@1.0.0 No repository field.
  49 verbose stack Error: EPERM: operation not permitted, unlink 'C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node'
  49 verbose stack     at Error (native)
  50 verbose cwd C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs
  51 verbose Windows_NT 6.1.7601
  52 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\a0717016\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-expat"
  53 verbose node v6.11.0
  54 verbose npm  v5.6.0
  55 error path C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node
  56 error code EPERM
  57 error errno -4048
  58 error syscall unlink
  59 error Error: EPERM: operation not permitted, unlink 'C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node'
  59 error     at Error (native)
  59 error  { Error: EPERM: operation not permitted, unlink 'C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node'
  59 error     at Error (native)
  59 error   cause:
  59 error    { Error: EPERM: operation not permitted, unlink 'C:\Projects\APP002-01\src\arte\AON.PhoenixRuleEngine.Arte\NodeJs\node_modules\.node-expat.DELETE\build\Release\node_expat.node'
  59 error        at Error (native)
  59 error      errno: -4048,
  59 error      code: 'EPERM',
  59 error      syscall: 'unlink',
  59 error      path: 'C:\\Projects\\APP002-01\\src\\arte\\AON.PhoenixRuleEngine.Arte\\NodeJs\\node_modules\\.node-expat.DELETE\\build\\Release\\node_expat.node' },
  59 error   stack: 'Error: EPERM: operation not permitted, unlink \'C:\\Projects\\APP002-01\\src\\arte\\AON.PhoenixRuleEngine.Arte\\NodeJs\\node_modules\\.node-expat.DELETE\\build\\Release\\node_expat.node\'\n    at Error (native)',
  59 error   errno: -4048,
  59 error   code: 'EPERM',
  59 error   syscall: 'unlink',
  59 error   path: 'C:\\Projects\\APP002-01\\src\\arte\\AON.PhoenixRuleEngine.Arte\\NodeJs\\node_modules\\.node-expat.DELETE\\build\\Release\\node_expat.node',
  59 error   parent: 'kissArteNode' }
  60 error Please try running this command again as root/Administrator.
  61 verbose exit [ -4048, true ]
  </code></pre>
  
  <p>Why is requesting on running as admin again?</p>
  
  <hr>
  
  <p>I'm facing exactly the same issue that this post: <a href="https://stackoverflow.com/questions/39556676/vscode-on-windows-10-activating-extension-failed-module-did-not-self-regis">vscode on Windows 10: Activating extension … failed: Module did not self-register</a></p>
  
  <p>The issue seems to be more related with VS Code rather than npm and nodejs. </p>