<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>51743</bug_id>
          
          <creation_ts>2024-10-17 17:43:12 +0300</creation_ts>
          <short_desc>Не работает команда `node-gyp rebuild`</short_desc>
          <delta_ts>2026-04-09 15:05:20 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>node-gyp</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexander Makeenkov">amakeenk</reporter>
          <assigned_to name="Vitaly Lipatov">lav</assigned_to>
          <cc>lav</cc>
    
    <cc>obidinog</cc>
    
    <cc>sychkinsv</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>253139</commentid>
    <comment_count>0</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2024-10-17 17:43:12 +0300</bug_when>
    <thetext>Версия пакета:
node-gyp-10.1.0-alt1

Шаги воспроизведения:
```
# apt-get install node-gyp npm node-addon-api
$ npm install bindings

$ cat &gt; binding.gyp &lt;&lt;EOF
{
  &quot;targets&quot;: [
    { 
      &quot;cflags!&quot;: [ &quot;-fno-exceptions&quot; ],
      &quot;cflags_cc!&quot;: [ &quot;-fno-exceptions&quot; ],
      &quot;include_dirs&quot; : [
        &quot;&lt;!@(node -p \&quot;require(&apos;node-addon-api&apos;).include\&quot;)&quot;
      ],
      &quot;target_name&quot;: &quot;hello_world&quot;,
      &quot;sources&quot;: [ &quot;hello_world.cc&quot; ],
      &apos;defines&apos;: [ &apos;NAPI_DISABLE_CPP_EXCEPTIONS&apos; ]
    }
  ]
}
EOF

$ cat &gt; hello_world.cc &lt;&lt;EOF
#include &lt;napi.h&gt;

Napi::String SayHi(const Napi::CallbackInfo&amp; info) {
  Napi::Env env = info.Env();

  return Napi::String::New(env, &quot;Hi!&quot;);
}

Napi::Object init(Napi::Env env, Napi::Object exports) {
    exports.Set(Napi::String::New(env, &quot;sayHi&quot;), Napi::Function::New(env, SayHi));
    return exports;
};

NODE_API_MODULE(hello_world, init);
EOF

$ cat &gt; main.js &lt;&lt;EOF
const hello_world = require(&apos;bindings&apos;)(&apos;hello_world&apos;)

console.log(hello_world.sayHi());
EOF

$ node-gyp configure
$ node-gyp build
$ node main.js
$ node-gyp rebuild
```

Получаемый результат:
```
$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@10.1.0
gyp info using node@20.17.0 | linux | x64
gyp info find Python using Python version 3.12.7 found at &quot;/usr/bin/python3&quot;
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack at loadConfigGypi (/usr/lib/node_modules/node-gyp/lib/build.js:48:15)
gyp ERR! stack at async build (/usr/lib/node_modules/node-gyp/lib/build.js:35:3)
gyp ERR! stack at async run (/usr/lib/node_modules/node-gyp/bin/node-gyp.js:81:18)
gyp ERR! System Linux 6.6.56-un-def-alt1
gyp ERR! command &quot;/usr/bin/node&quot; &quot;/usr/bin/node-gyp&quot; &quot;rebuild&quot;
gyp ERR! cwd /home/test/q
gyp ERR! node -v v20.17.0
gyp ERR! node-gyp -v v10.1.0
gyp ERR! not ok 
```

Выполнение configure не помогает, ошибка с таким же сообщением всё равно остаётся.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>278978</commentid>
    <comment_count>1</comment_count>
    <who name="obidinog@basealt.ru">obidinog</who>
    <bug_when>2025-12-12 14:53:04 +0300</bug_when>
    <thetext>Актуально для 
node-gyp-11.0.0-alt1
node-22.19.0-alt1

gyp info it worked if it ends with ok
gyp info using node-gyp@11.0.0
gyp info using node@22.19.0 | linux | x64
gyp info find Python using Python version 3.13.11 found at &quot;/usr/bin/python3&quot;
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack at loadConfigGypi (/usr/lib/node_modules/node-gyp/lib/build.js:49:15)
gyp ERR! stack at async build (/usr/lib/node_modules/node-gyp/lib/build.js:36:3)
gyp ERR! stack at async run (/usr/lib/node_modules/node-gyp/bin/node-gyp.js:81:18)
gyp ERR! System Linux 6.12.61-6.12-alt1
gyp ERR! command &quot;/usr/bin/node&quot; &quot;/usr/bin/node-gyp&quot; &quot;rebuild&quot;
gyp ERR! cwd /tmp/.private/root/05_node-gyp_rebuild_test-rIAfKp2TfO
gyp ERR! node -v v22.19.0
gyp ERR! node-gyp -v v11.0.0
gyp ERR! not ok</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>278997</commentid>
    <comment_count>2</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2025-12-13 04:34:43 +0300</bug_when>
    <thetext>У меня воспроизводится поломка, но с другой ошибкой

node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@11.0.0
gyp info using node@22.19.0 | linux | x64
gyp info find Python using Python version 3.13.11 found at &quot;/bin/python3&quot;
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack at loadConfigGypi (/usr/lib/node_modules/node-gyp/lib/build.js:49:15)
gyp ERR! stack at async build (/usr/lib/node_modules/node-gyp/lib/build.js:36:3)
gyp ERR! stack at async run (/usr/lib/node_modules/node-gyp/bin/node-gyp.js:81:18)
gyp ERR! System Linux 6.12.54-6.12-alt1
gyp ERR! command &quot;/usr/bin/node&quot; &quot;/bin/node-gyp&quot; &quot;rebuild&quot;
gyp ERR! cwd /srv/lav/Projects/git-alt/node/8
gyp ERR! node -v v22.19.0
gyp ERR! node-gyp -v v11.0.0
gyp ERR! not ok 

Она из-за пустого build/config.gypi

но node-gyp configure
это лечит.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>285475</commentid>
    <comment_count>3</comment_count>
    <who name="Сычкин Сергей Витальевич">sychkinsv</who>
    <bug_when>2026-04-09 15:05:20 +0300</bug_when>
    <thetext>Воспроизводится:

gyp info it worked if it ends with ok
gyp info using node-gyp@12.2.0
gyp info using node@22.19.0 | linux | x64
gyp info find Python using Python version 3.13.12 found at &quot;/usr/bin/python3&quot;
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack at loadConfigGypi (/usr/lib/node_modules/node-gyp/lib/build.js:49:15)
gyp ERR! stack at async build (/usr/lib/node_modules/node-gyp/lib/build.js:36:3)
gyp ERR! stack at async run (/usr/lib/node_modules/node-gyp/bin/node-gyp.js:81:18)
gyp ERR! System Linux 6.12.33-6.12-alt1
gyp ERR! command &quot;/usr/bin/node&quot; &quot;/usr/bin/node-gyp&quot; &quot;rebuild&quot;
gyp ERR! cwd /home/test
gyp ERR! node -v v22.19.0
gyp ERR! node-gyp -v v12.2.0
gyp ERR! not ok</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>