Skip to content

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

Closed as not planned

Description

@MahomedCissokho

Details

Hi !, I have a project with this configuration : React - Tailwindcss . When I try to run my react project with this command :
npm run dev, I got this error :

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

npm ERR! A complete log of this run can be found in: C:\Users\HP\AppData\Local\npm-cache_logs\2023-06-13T17_53_31_498Z-debug-0.log

Note: I have installed react using vite .

Node.js version

v18.15.0

Example code

No response

Operating system

Windows 10

Scope

Issue occured when I run the cmd : npm run dev

Module and version

Not applicable.

Activity

  1. MahomedCissokho commented on Jun 13, 2023

    @MahomedCissokho
    Author

    npm ERR! A complete log of this run can be found in: C:\Users\HP\AppData\Local\npm-cache_logs\2023-06-13T17_53_31_498Z-debug-0.log

    content of this file :
    0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
    1 info using npm@9.6.7
    2 info using node@v18.15.0
    3 timing npm:load:whichnode Completed in 4ms
    4 timing config:load:defaults Completed in 4ms
    5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 4ms
    6 timing config:load:builtin Completed in 4ms
    7 timing config:load:cli Completed in 2ms
    8 timing config:load:env Completed in 2ms
    9 timing config:load:file:C:\Users\HP\Desktop\my-portfolio.npmrc Completed in 1ms
    10 timing config:load:project Completed in 6ms
    11 timing config:load:file:C:\Users\HP.npmrc Completed in 0ms
    12 timing config:load:user Completed in 1ms
    13 timing config:load:file:C:\Program Files\nodejs\etc\npmrc Completed in 0ms
    14 timing config:load:global Completed in 0ms
    15 timing config:load:setEnvs Completed in 2ms
    16 timing config:load Completed in 23ms
    17 timing npm:load:configload Completed in 23ms
    18 timing npm:load:mkdirpcache Completed in 1ms
    19 timing npm:load:mkdirplogs Completed in 0ms
    20 verbose title npm run dev
    21 verbose argv "run" "dev"
    22 timing npm:load:setTitle Completed in 2ms
    23 timing config:load:flatten Completed in 10ms
    24 timing npm:load:display Completed in 11ms
    25 verbose logfile logs-max:10 dir:C:\Users\HP\AppData\Local\npm-cache_logs\2023-06-13T18_21_50_940Z-
    26 verbose logfile C:\Users\HP\AppData\Local\npm-cache_logs\2023-06-13T18_21_50_940Z-debug-0.log
    27 timing npm:load:logFile Completed in 22ms
    28 timing npm:load:timers Completed in 0ms
    29 timing npm:load:configScope Completed in 0ms
    30 timing npm:load Completed in 64ms
    31 timing command:run Completed in 44ms
    32 verbose stack TypeError: Cannot read properties of undefined (reading 'stdin')
    32 verbose stack at promiseSpawn (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:60:18)
    32 verbose stack at spawnWithShell (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:123:10)
    32 verbose stack at promiseSpawn (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:12:12)
    32 verbose stack at runScriptPkg (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\run-script\lib\run-script-pkg.js:79:13)
    32 verbose stack at runScript (C:\Program Files\nodejs\node_modules\npm\node_modules@npmcli\run-script\lib\run-script.js:9:16)
    32 verbose stack at RunScript.run (C:\Program Files\nodejs\node_modules\npm\lib\commands\run-script.js:120:13)
    32 verbose stack at async module.exports (C:\Program Files\nodejs\node_modules\npm\lib\cli.js:89:5)
    33 verbose cwd C:\Users\HP\Desktop\my-portfolio
    34 verbose Windows_NT 10.0.19045
    35 verbose node v18.15.0
    36 verbose npm v9.6.7
    37 error Cannot read properties of undefined (reading 'stdin')
    38 verbose exit 1
    39 timing npm Completed in 165ms
    40 verbose code 1
    41 error A complete log of this run can be found in: C:\Users\HP\AppData\Local\npm-cache_logs\2023-06-13T18_21_50_940Z-debug-0.log

  2. osamajavaid commented on Jul 13, 2023

    @osamajavaid

    facing the same issue, since morning

  3. preveen-stack commented on Aug 25, 2023

    @preveen-stack
    Contributor

    cc @nodejs/npm PTAL

  4. github-actions commented on May 7, 2024

    @github-actions

    It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment.
    If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
    Make sure to look at the README file for the most updated links.

  5. github-actions commented on Jun 7, 2024

    @github-actions

    It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment.
    If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
    Make sure to look at the README file for the most updated links.

  6. Panossa commented on Jan 22, 2026

    @Panossa

    Hi, just to add context for people finding this while searching:
    I believe this is a case where npm run breaks in general, not just in the context of react or any npm packages. Updating (multiple?) major versions and/or at least using v24+ might fix this.
    See this comment of mine on #4138 for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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