title: npm ERR! Cannot read properties of undefined (reading 'stdin')
body: <p>I have an error when running vue.js 3  with vite</p>
  <p><a href="https://i.stack.imgur.com/DGHPu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DGHPu.png" alt="1" /></a></p>
  <p>I added nodejs into Variable Environments before</p>
  <p>I have tried these things but not working</p>
  <ul>
  <li>using <code>npm cache clear</code> &amp; <code>npm cache clear --force</code> but still error and receive <code>npm WARN using --force Recommended protections disabled.</code></li>
  <li>deleted node_modules folder and package.lock.json and run <code>npm install</code></li>
  <li>re-clone my repo on Github</li>
  <li>re-installed Nodejs, VSCode, vite.js, update to latest npm</li>
  </ul>
  <p>Debug log:</p>
  <pre><code>0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
  0 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
  0 verbose cli   'run',
  0 verbose cli   'dev'
  0 verbose cli ]
  1 info using npm@8.1.2
  2 info using node@v17.1.0
  3 timing npm:load:whichnode Completed in 1ms
  4 timing config:load:defaults Completed in 1ms
  5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
  6 timing config:load:builtin Completed in 2ms
  7 timing config:load:cli Completed in 1ms
  8 timing config:load:env Completed in 1ms
  9 timing config:load:file:C:\Users\Admin\Desktop\xfago-cms-vue\.npmrc Completed in 0ms
  10 timing config:load:project Completed in 0ms
  11 timing config:load:file:C:\Users\Admin\.npmrc Completed in 0ms
  12 timing config:load:user Completed in 0ms
  13 timing config:load:file:C:\Users\Admin\AppData\Roaming\npm\etc\npmrc Completed in 1ms
  14 timing config:load:global Completed in 1ms
  15 timing config:load:validate Completed in 0ms
  16 timing config:load:credentials Completed in 0ms
  17 timing config:load:setEnvs Completed in 1ms
  18 timing config:load Completed in 7ms
  19 timing npm:load:configload Completed in 7ms
  20 timing npm:load:setTitle Completed in 0ms
  21 timing npm:load:setupLog Completed in 0ms
  22 timing config:load:flatten Completed in 2ms
  23 timing npm:load:cleanupLog Completed in 1ms
  24 timing npm:load:configScope Completed in 0ms
  25 timing npm:load:projectScope Completed in 1ms
  26 timing npm:load Completed in 12ms
  27 timing command:run-script Completed in 7ms
  28 verbose stack TypeError: Cannot read properties of undefined (reading 'stdin')
  28 verbose stack     at promiseSpawnUid (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:70:18)
  28 verbose stack     at promiseSpawn (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:15:10)
  28 verbose stack     at runScriptPkg (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:54:13)
  28 verbose stack     at runScript (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:16)
  28 verbose stack     at RunScript.run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:129:13)
  29 verbose cwd C:\Users\Admin\Desktop\xfago-cms-vue
  30 verbose Windows_NT 10.0.19043
  31 verbose argv &quot;C:\\Program Files\\nodejs\\node.exe&quot; &quot;C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js&quot; &quot;run&quot; &quot;dev&quot;
  32 verbose node v17.1.0
  33 verbose npm  v8.1.2
  34 error Cannot read properties of undefined (reading 'stdin')
  35 verbose exit 1```
  </code></pre>