Skip to content

Cannot read properties of undefined (reading 'stdin') #4138

@sk8gear

Description

@sk8gear

Details

I was trying to test Vuejs 3 by creating a new Vuejs 3 project, then try to run it by using "npm run serve". This is what I got:

$ npm run build

> vue-test-003@0.1.0 build
> vue-cli-service build

npm ERR! Cannot read properties of undefined (reading 'stdin')

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\devcomp\AppData\Local\npm-cache\_logs\2023-03-31T05_12_09_205Z-debug-0.log

And here's the content of .log file:

0 verbose cli C:\Program Files\nodejs\node.exe C:\Users\devcomp\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
1 info using npm@9.6.2
2 info using node@v18.15.0
3 timing npm:load:whichnode Completed in 3ms
4 timing config:load:defaults Completed in 3ms
5 timing config:load:file:C:\Users\devcomp\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 3ms
6 timing config:load:builtin Completed in 4ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:D:\testdir\vue-test-003\.npmrc Completed in 0ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:C:\Users\devcomp\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\devcomp\AppData\Roaming\npm\etc\npmrc Completed in 2ms
14 timing config:load:global Completed in 2ms
15 timing config:load:setEnvs Completed in 2ms
16 timing config:load Completed in 19ms
17 timing npm:load:configload Completed in 19ms
18 timing npm:load:mkdirpcache Completed in 1ms
19 timing npm:load:mkdirplogs Completed in 0ms
20 verbose title npm run build
21 verbose argv "run" "build"
22 timing npm:load:setTitle Completed in 2ms
23 timing config:load:flatten Completed in 6ms
24 timing npm:load:display Completed in 8ms
25 verbose logfile logs-max:10 dir:C:\Users\devcomp\AppData\Local\npm-cache\_logs\2023-03-31T05_12_09_205Z-
26 verbose logfile C:\Users\devcomp\AppData\Local\npm-cache\_logs\2023-03-31T05_12_09_205Z-debug-0.log
27 timing npm:load:logFile Completed in 13ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 47ms
31 silly logfile start cleaning logs, removing 10 files
32 timing command:run Completed in 19ms
33 verbose stack TypeError: Cannot read properties of undefined (reading 'stdin')
33 verbose stack     at promiseSpawn (C:\Users\devcomp\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:60:18)
33 verbose stack     at spawnWithShell (C:\Users\devcomp\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:123:10)
33 verbose stack     at promiseSpawn (C:\Users\devcomp\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:12:12)
33 verbose stack     at runScriptPkg (C:\Users\devcomp\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:79:13)
33 verbose stack     at runScript (C:\Users\devcomp\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:16)
33 verbose stack     at RunScript.run (C:\Users\devcomp\AppData\Roaming\npm\node_modules\npm\lib\commands\run-script.js:129:13)
33 verbose stack     at async module.exports (C:\Users\devcomp\AppData\Roaming\npm\node_modules\npm\lib\cli.js:134:5)
34 verbose cwd D:\testdir\vue-test-003
35 verbose Windows_NT 10.0.19045
36 verbose node v18.15.0
37 verbose npm  v9.6.2
38 error Cannot read properties of undefined (reading 'stdin')
39 verbose exit 1
40 timing npm Completed in 105ms
41 verbose code 1
42 error A complete log of this run can be found in:
42 error     C:\Users\devcomp\AppData\Local\npm-cache\_logs\2023-03-31T05_12_09_205Z-debug-0.log

(https://github.com/nodejs/help/files/11118438/2023-03-31T05_12_09_205Z-debug-0.log)

So far, I've tried reinstalling nodejs and using the latest version (Node.js 19.8.1) and have had no luck. I also tried to remove all npm and npm-cache in AppData/Local and AppData/Roaming, reinstall it, and tried to run "npm run serve" again and still return exact same error as above.

Node.js version

Node.js version v18.15.0

Example code

No response

Operating system

Currently using Windows 10

Scope

Issue occured when I tried to run "npm run serve" on Vuejs project.

Module and version

Not applicable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions