kelektiv / node.bcrypt.js

bcrypt for NodeJs
MIT License
7.49k stars 518 forks source link

Error when installing bcrypt with node 15 #848

Open nephix opened 3 years ago

nephix commented 3 years ago

The bcrypt version I use is 5.0.0 and my OS is macOS 11.1

$ node -v
v15.5.1

I followed a suggestion in https://github.com/nodejs/node-gyp/issues/2245 to force/global install bcrypt but it didn't work out as well. In both cases, the error message is the same

$ npm install --force --global bcrypt@latest

npm WARN using --force Recommended protections disabled.

added 68 packages, and audited 69 packages in 8s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ npm i
npm ERR! code 1
npm ERR! path /Users/xxx/Projects/zzz/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@15.5.1 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.1 found at "/usr/local/opt/python@3.9/bin/python3.9"
npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/xxx/.nvm/versions/node/v15.5.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/xxx/Projects/zzz/node_modules/bcrypt/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/xxx/.nvm/versions/node/v15.5.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/xxx/Library/Caches/node-gyp/15.5.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/xxx/Library/Caches/node-gyp/15.5.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/xxx/.nvm/versions/node/v15.5.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/xxx/Library/Caches/node-gyp/15.5.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/xxx/Projects/zzz/node_modules/bcrypt',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/xxx/.nvm/versions/node/v15.5.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12)
npm ERR! gyp ERR! System Darwin 20.2.0
npm ERR! gyp ERR! command "/Users/xxx/.nvm/versions/node/v15.5.1/bin/node" "/Users/xxx/.nvm/versions/node/v15.5.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/xxx/Projects/zzz/node_modules/bcrypt
npm ERR! gyp ERR! node -v v15.5.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxx/.npm/_logs/2021-01-08T18_09_40_256Z-debug.log
recrsn commented 3 years ago

@nephix It should not trigger a build for you

Is there any other add-on that messes up with the node-gyp version we depend on? Can you post your dependencies?

i176i commented 3 years ago

bcrypt only supports the LTS version of node, if you are on any other patch other than LTS then use nvm to switch on to the LTS version of node

nephix commented 3 years ago

That makes sense, thank you

recrsn commented 3 years ago

@surjeetsinghofficial123 @nephix bcrypt supports all versions of NodeJS since 10 including non-LTS ones

nephix commented 3 years ago

But why didn't it work for Node 15? Even tested in an empty project

recrsn commented 3 years ago

It installs properly as global for you. Not sure whats the issue while compiling.

I tested on a Mac (10.15) and it installs properly. Can you provide me with npm logs? It will be located in a file like this /Users/xxx/.npm/_logs/2021-01-08T18_09_40_256Z-debug.log

benpoole commented 3 years ago

Exact same issue for me on macOS 10.14.6 running node version 15.6.0. I downgraded to LTS (14.15.4 at the time of writing) and the problem went away.

nephix commented 3 years ago

Ok if others encounter this as well I think we should re-open the issue

recrsn commented 3 years ago

Please provide logs. I do not have Big Sur yet, other than that I am unable to reproduce this. Even our CI is green for NodeJS 15.

It could be an issue with XCode as well

timja commented 3 years ago

I hit this too

I'm on Big Sur and an M1 mac

Debug logs ``` 0 verbose cli [ 0 verbose cli '/usr/local/Cellar/node/15.3.0/bin/node', 0 verbose cli '/usr/local/bin/npm', 0 verbose cli 'install' 0 verbose cli ] 1 info using npm@7.5.2 2 info using node@v15.3.0 3 timing config:load:defaults Completed in 2ms 4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms 5 timing config:load:builtin Completed in 1ms 6 timing config:load:cli Completed in 1ms 7 timing config:load:env Completed in 1ms 8 timing config:load:file:/Users/timja/code/jenkins/incrementals-publisher/.npmrc Completed in 0ms 9 timing config:load:project Completed in 0ms 10 timing config:load:file:/Users/timja/.npmrc Completed in 0ms 11 timing config:load:user Completed in 0ms 12 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms 13 timing config:load:global Completed in 1ms 14 timing config:load:cafile Completed in 0ms 15 timing config:load:validate Completed in 0ms 16 timing config:load:setUserAgent Completed in 0ms 17 timing config:load:setEnvs Completed in 1ms 18 timing config:load Completed in 7ms 19 verbose npm-session 3776859e26e01fe4 20 timing npm:load Completed in 14ms 21 timing arborist:ctor Completed in 1ms 22 timing idealTree:init Completed in 173ms 23 timing idealTree:userRequests Completed in 0ms 24 silly idealTree buildDeps 25 timing idealTree:#root Completed in 1ms 26 timing idealTree:buildDeps Completed in 1ms 27 timing idealTree:fixDepFlags Completed in 0ms 28 timing idealTree Completed in 179ms 29 timing reify:loadTrees Completed in 186ms 30 timing reify:diffTrees Completed in 4ms 31 silly reify moves {} 32 timing reify:retireShallow Completed in 0ms 33 timing reify:createSparse Completed in 31ms 34 timing reify:loadBundles Completed in 0ms 35 timing reifyNode:node_modules/osenv Completed in 784ms 36 timing reifyNode:node_modules/natural-compare Completed in 784ms 37 timing reifyNode:node_modules/yargs-unparser/node_modules/p-locate Completed in 795ms 38 timing reifyNode:node_modules/yargs-unparser/node_modules/locate-path Completed in 796ms 39 timing reifyNode:node_modules/yargs/node_modules/path-exists Completed in 796ms 40 timing reifyNode:node_modules/yargs-unparser/node_modules/find-up Completed in 796ms 41 timing reifyNode:node_modules/yargs/node_modules/p-locate Completed in 796ms 42 timing reifyNode:node_modules/yargs/node_modules/find-up Completed in 796ms 43 timing reifyNode:node_modules/yargs-unparser/node_modules/path-exists Completed in 796ms 44 timing reifyNode:node_modules/yargs/node_modules/locate-path Completed in 796ms 45 timing reifyNode:node_modules/wrap-ansi Completed in 795ms 46 timing reifyNode:node_modules/wrap-ansi/node_modules/ansi-regex Completed in 796ms 47 timing reifyNode:node_modules/wrappy Completed in 797ms 48 timing reifyNode:node_modules/wide-align/node_modules/string-width Completed in 796ms 49 timing reifyNode:node_modules/wide-align Completed in 796ms 50 timing reifyNode:node_modules/wide-align/node_modules/ansi-regex Completed in 796ms 51 timing reifyNode:node_modules/wide-align/node_modules/strip-ansi Completed in 796ms 52 timing reifyNode:node_modules/toidentifier Completed in 797ms 53 timing reifyNode:node_modules/string-width/node_modules/ansi-regex Completed in 796ms 54 timing reifyNode:node_modules/string-width Completed in 797ms 55 timing reifyNode:node_modules/slice-ansi Completed in 797ms 56 timing reifyNode:node_modules/simple-swizzle Completed in 797ms 57 timing reifyNode:node_modules/shebang-command Completed in 797ms 58 timing reifyNode:node_modules/send/node_modules/ms Completed in 797ms 59 timing reifyNode:node_modules/send/node_modules/debug/node_modules/ms Completed in 797ms 60 timing reifyNode:node_modules/resolve-from Completed in 799ms 61 timing reifyNode:node_modules/rc/node_modules/strip-json-comments Completed in 799ms 62 timing reifyNode:node_modules/process-nextick-args Completed in 799ms 63 timing reifyNode:node_modules/path-is-absolute Completed in 800ms 64 timing reifyNode:node_modules/parent-module Completed in 800ms 65 timing reifyNode:node_modules/os-tmpdir Completed in 799ms 66 timing reifyNode:node_modules/os-homedir Completed in 799ms 67 timing reifyNode:node_modules/once Completed in 799ms 68 timing reifyNode:node_modules/object-assign Completed in 799ms 69 timing reifyNode:node_modules/number-is-nan Completed in 799ms 70 timing reifyNode:node_modules/npm-packlist Completed in 800ms 71 timing reifyNode:node_modules/normalize-path Completed in 800ms 72 timing reifyNode:node_modules/npm-bundled Completed in 800ms 73 timing reifyNode:node_modules/ms Completed in 800ms 74 timing reifyNode:node_modules/isarray Completed in 800ms 75 timing reifyNode:node_modules/is-number Completed in 801ms 76 timing reifyNode:node_modules/is-glob Completed in 801ms 77 timing reifyNode:node_modules/is-fullwidth-code-point Completed in 801ms 78 timing reifyNode:node_modules/is-plain-obj Completed in 801ms 79 timing reifyNode:node_modules/is-extglob Completed in 800ms 80 timing reifyNode:node_modules/ini Completed in 800ms 81 timing reifyNode:node_modules/imurmurhash Completed in 800ms 82 timing reifyNode:node_modules/ignore-walk Completed in 800ms 83 timing reifyNode:node_modules/inflight Completed in 800ms 84 timing reifyNode:node_modules/glob-parent Completed in 801ms 85 timing reifyNode:node_modules/has-unicode Completed in 801ms 86 timing reifyNode:node_modules/has-flag Completed in 801ms 87 timing reifyNode:node_modules/gauge/node_modules/ansi-regex Completed in 801ms 88 timing reifyNode:node_modules/gauge/node_modules/string-width Completed in 801ms 89 timing reifyNode:node_modules/gauge/node_modules/is-fullwidth-code-point Completed in 801ms 90 timing reifyNode:node_modules/fs-minipass Completed in 801ms 91 timing reifyNode:node_modules/gauge/node_modules/strip-ansi Completed in 801ms 92 timing reifyNode:node_modules/finalhandler/node_modules/ms Completed in 802ms 93 timing reifyNode:node_modules/fast-levenshtein Completed in 802ms 94 timing reifyNode:node_modules/express/node_modules/ms Completed in 801ms 95 timing reifyNode:node_modules/escape-string-regexp Completed in 802ms 96 timing reifyNode:node_modules/ee-first Completed in 802ms 97 timing reifyNode:node_modules/destroy Completed in 802ms 98 timing reifyNode:node_modules/decamelize Completed in 803ms 99 timing reifyNode:node_modules/escape-html Completed in 803ms 100 timing reifyNode:node_modules/code-point-at Completed in 802ms 101 timing reifyNode:node_modules/chownr Completed in 803ms 102 timing reifyNode:node_modules/chalk/node_modules/color-name Completed in 803ms 103 timing reifyNode:node_modules/cliui/node_modules/ansi-regex Completed in 803ms 104 timing reifyNode:node_modules/browser-stdout Completed in 803ms 105 timing reifyNode:node_modules/brace-expansion Completed in 803ms 106 timing reifyNode:node_modules/body-parser/node_modules/ms Completed in 803ms 107 timing reifyNode:node_modules/astral-regex Completed in 803ms 108 timing reifyNode:node_modules/array-flatten Completed in 803ms 109 timing reifyNode:node_modules/ansi-styles Completed in 804ms 110 timing reifyNode:node_modules/aproba Completed in 804ms 111 timing reifyNode:node_modules/abbrev Completed in 804ms 112 timing reifyNode:node_modules/yargs-unparser/node_modules/p-limit Completed in 813ms 113 timing reifyNode:node_modules/@types/color-name Completed in 806ms 114 timing reifyNode:node_modules/yargs/node_modules/p-limit Completed in 814ms 115 timing reifyNode:node_modules/y18n Completed in 814ms 116 timing reifyNode:node_modules/word-wrap Completed in 813ms 117 timing reifyNode:node_modules/write Completed in 814ms 118 timing reifyNode:node_modules/which-module Completed in 813ms 119 timing reifyNode:node_modules/utils-merge Completed in 813ms 120 timing reifyNode:node_modules/vary Completed in 813ms 121 timing reifyNode:node_modules/wrap-ansi/node_modules/strip-ansi Completed in 813ms 122 timing reifyNode:node_modules/type-is Completed in 813ms 123 timing reifyNode:node_modules/unpipe Completed in 813ms 124 timing reifyNode:node_modules/to-regex-range Completed in 813ms 125 timing reifyNode:node_modules/text-hex Completed in 814ms 126 timing reifyNode:node_modules/supports-color Completed in 813ms 127 timing reifyNode:node_modules/strip-json-comments Completed in 814ms 128 timing reifyNode:node_modules/strip-ansi Completed in 814ms 129 timing reifyNode:node_modules/string-width/node_modules/strip-ansi Completed in 814ms 130 timing reifyNode:node_modules/shebang-regex Completed in 814ms 131 timing reifyNode:node_modules/set-blocking Completed in 814ms 132 timing reifyNode:node_modules/require-main-filename Completed in 815ms 133 timing reifyNode:node_modules/range-parser Completed in 814ms 134 timing reifyNode:node_modules/path-key Completed in 816ms 135 timing reifyNode:node_modules/path-to-regexp Completed in 818ms 136 timing reifyNode:node_modules/path-exists Completed in 818ms 137 timing reifyNode:node_modules/parseurl Completed in 819ms 138 timing reifyNode:node_modules/p-locate Completed in 819ms 139 timing reifyNode:node_modules/p-try Completed in 819ms 140 timing reifyNode:node_modules/p-limit Completed in 819ms 141 timing reifyNode:node_modules/one-time Completed in 818ms 142 timing reifyNode:node_modules/on-finished Completed in 818ms 143 timing reifyNode:node_modules/mocha/node_modules/has-flag Completed in 819ms 144 timing reifyNode:node_modules/mocha/node_modules/supports-color Completed in 819ms 145 timing reifyNode:node_modules/mocha/node_modules/escape-string-regexp Completed in 819ms 146 timing reifyNode:node_modules/minipass Completed in 819ms 147 timing reifyNode:node_modules/minizlib Completed in 819ms 148 timing reifyNode:node_modules/mime-types Completed in 820ms 149 timing reifyNode:node_modules/mocha/node_modules/strip-json-comments Completed in 821ms 150 timing reifyNode:node_modules/media-typer Completed in 820ms 151 timing reifyNode:node_modules/merge-descriptors Completed in 820ms 152 timing reifyNode:node_modules/methods Completed in 820ms 153 timing reifyNode:node_modules/locate-path Completed in 820ms 154 timing reifyNode:node_modules/is-stream Completed in 820ms 155 timing reifyNode:node_modules/is-buffer Completed in 822ms 156 timing reifyNode:node_modules/is-binary-path Completed in 823ms 157 timing reifyNode:node_modules/inherits Completed in 823ms 158 timing reifyNode:node_modules/import-fresh Completed in 823ms 159 timing reifyNode:node_modules/http-errors/node_modules/inherits Completed in 823ms 160 timing reifyNode:node_modules/forwarded Completed in 824ms 161 timing reifyNode:node_modules/finalhandler Completed in 824ms 162 timing reifyNode:node_modules/fresh Completed in 824ms 163 timing reifyNode:node_modules/find-up Completed in 824ms 164 timing reifyNode:node_modules/fill-range Completed in 824ms 165 timing reifyNode:node_modules/etag Completed in 825ms 166 timing reifyNode:node_modules/encodeurl Completed in 826ms 167 timing reifyNode:node_modules/cookie-signature Completed in 826ms 168 timing reifyNode:node_modules/content-type Completed in 827ms 169 timing reifyNode:node_modules/colorspace Completed in 827ms 170 timing reifyNode:node_modules/console-control-strings Completed in 827ms 171 timing reifyNode:node_modules/color-string Completed in 827ms 172 timing reifyNode:node_modules/color Completed in 827ms 173 timing reifyNode:node_modules/cliui/node_modules/strip-ansi Completed in 826ms 174 timing reifyNode:node_modules/chalk/node_modules/supports-color Completed in 826ms 175 timing reifyNode:node_modules/camelcase Completed in 826ms 176 timing reifyNode:node_modules/callsites Completed in 826ms 177 timing reifyNode:node_modules/chalk/node_modules/has-flag Completed in 826ms 178 timing reifyNode:node_modules/bytes Completed in 826ms 179 timing reifyNode:node_modules/balanced-match Completed in 827ms 180 timing reifyNode:node_modules/accepts Completed in 827ms 181 timing reifyNode:node_modules/anymatch Completed in 827ms 182 timing reifyNode:node_modules/ansi-regex Completed in 827ms 183 timing reifyNode:node_modules/@babel/highlight Completed in 827ms 184 timing reifyNode:node_modules/@babel/code-frame Completed in 827ms 185 timing reifyNode:node_modules/yargs-unparser Completed in 837ms 186 timing reifyNode:node_modules/yallist Completed in 837ms 187 timing reifyNode:node_modules/util-deprecate Completed in 836ms 188 timing reifyNode:node_modules/string_decoder Completed in 836ms 189 timing reifyNode:node_modules/simple-mock Completed in 836ms 190 timing reifyNode:node_modules/signal-exit Completed in 837ms 191 timing reifyNode:node_modules/rimraf Completed in 837ms 192 timing reifyNode:node_modules/proxy-addr Completed in 836ms 193 timing reifyNode:node_modules/minimatch Completed in 838ms 194 timing reifyNode:node_modules/log-symbols Completed in 843ms 195 timing reifyNode:node_modules/kuler Completed in 843ms 196 timing reifyNode:node_modules/is-plain-object Completed in 843ms 197 timing reifyNode:node_modules/js-tokens Completed in 844ms 198 timing reifyNode:node_modules/http-errors Completed in 843ms 199 timing reifyNode:node_modules/get-caller-file Completed in 843ms 200 timing reifyNode:node_modules/fs.realpath Completed in 844ms 201 timing reifyNode:node_modules/esrecurse Completed in 844ms 202 timing reifyNode:node_modules/enabled Completed in 844ms 203 timing reifyNode:node_modules/cookie Completed in 845ms 204 timing reifyNode:node_modules/cliui Completed in 845ms 205 timing reifyNode:node_modules/chalk/node_modules/ansi-styles Completed in 845ms 206 timing reifyNode:node_modules/v8-compile-cache Completed in 854ms 207 timing reifyNode:node_modules/winston-transport/node_modules/string_decoder Completed in 854ms 208 timing reifyNode:node_modules/winston-transport/node_modules/safe-buffer Completed in 854ms 209 timing reifyNode:node_modules/which Completed in 854ms 210 timing reifyNode:node_modules/stack-trace Completed in 853ms 211 timing reifyNode:node_modules/setprototypeof Completed in 853ms 212 timing reifyNode:node_modules/serve-static Completed in 853ms 213 timing reifyNode:node_modules/serialize-javascript Completed in 854ms 214 timing reifyNode:node_modules/readdirp Completed in 854ms 215 timing reifyNode:node_modules/npmlog Completed in 854ms 216 timing reifyNode:node_modules/mkdirp Completed in 855ms 217 timing reifyNode:node_modules/has Completed in 854ms 218 timing reifyNode:node_modules/file-entry-cache Completed in 857ms 219 timing reifyNode:node_modules/fn.name Completed in 857ms 220 timing reifyNode:node_modules/express-async-wrap Completed in 856ms 221 timing reifyNode:node_modules/express/node_modules/safe-buffer Completed in 857ms 222 timing reifyNode:node_modules/deep-extend Completed in 858ms 223 timing reifyNode:node_modules/content-disposition Completed in 858ms 224 timing reifyNode:node_modules/color-name Completed in 859ms 225 timing reifyNode:node_modules/content-disposition/node_modules/safe-buffer Completed in 860ms 226 timing reifyNode:node_modules/binary-extensions Completed in 862ms 227 timing reifyNode:node_modules/are-we-there-yet/node_modules/string_decoder Completed in 862ms 228 timing reifyNode:node_modules/are-we-there-yet/node_modules/safe-buffer Completed in 862ms 229 timing reifyNode:node_modules/acorn-jsx Completed in 862ms 230 timing reifyNode:node_modules/winston-transport/node_modules/isarray Completed in 870ms 231 timing reifyNode:node_modules/type-check Completed in 870ms 232 timing reifyNode:node_modules/send Completed in 870ms 233 timing reifyNode:node_modules/safe-buffer Completed in 870ms 234 timing reifyNode:node_modules/sax Completed in 870ms 235 timing reifyNode:node_modules/require-directory Completed in 870ms 236 timing reifyNode:node_modules/raw-body Completed in 869ms 237 timing reifyNode:node_modules/punycode Completed in 869ms 238 timing reifyNode:node_modules/randombytes Completed in 869ms 239 timing reifyNode:node_modules/node-stream-zip Completed in 869ms 240 timing reifyNode:node_modules/is-arrayish Completed in 873ms 241 timing reifyNode:node_modules/globals Completed in 874ms 242 timing reifyNode:node_modules/are-we-there-yet/node_modules/isarray Completed in 874ms 243 timing reifyNode:node_modules/statuses Completed in 882ms 244 timing reifyNode:node_modules/progress Completed in 882ms 245 timing reifyNode:node_modules/levn Completed in 881ms 246 timing reifyNode:node_modules/fsevents Completed in 881ms 247 timing reifyNode:node_modules/flat Completed in 881ms 248 timing reifyNode:node_modules/es-array-method-boxes-properly Completed in 881ms 249 timing reifyNode:node_modules/eslint-visitor-keys Completed in 881ms 250 timing reifyNode:node_modules/delegates Completed in 881ms 251 timing reifyNode:node_modules/core-util-is Completed in 882ms 252 timing reifyNode:node_modules/concat-map Completed in 882ms 253 timing reifyNode:node_modules/color-convert Completed in 882ms 254 timing reifyNode:node_modules/chalk/node_modules/color-convert Completed in 881ms 255 timing reifyNode:node_modules/ansi-colors Completed in 881ms 256 timing reifyNode:node_modules/safer-buffer Completed in 889ms 257 timing reifyNode:node_modules/nopt Completed in 892ms 258 timing reifyNode:node_modules/isexe Completed in 895ms 259 timing reifyNode:node_modules/fast-safe-stringify Completed in 895ms 260 timing reifyNode:node_modules/express-winston/node_modules/chalk Completed in 894ms 261 timing reifyNode:node_modules/estraverse Completed in 896ms 262 timing reifyNode:node_modules/esrecurse/node_modules/estraverse Completed in 896ms 263 timing reifyNode:node_modules/esquery/node_modules/estraverse Completed in 896ms 264 timing reifyNode:node_modules/detect-libc Completed in 896ms 265 timing reifyNode:node_modules/@babel/highlight/node_modules/chalk Completed in 904ms 266 timing reifyNode:node_modules/yargs-unparser/node_modules/yargs-parser Completed in 913ms 267 timing reifyNode:node_modules/yargs-parser Completed in 914ms 268 timing reifyNode:node_modules/optionator Completed in 911ms 269 timing reifyNode:node_modules/negotiator Completed in 911ms 270 timing reifyNode:node_modules/node-pre-gyp/node_modules/semver Completed in 912ms 271 timing reifyNode:node_modules/ipaddr.js Completed in 915ms 272 timing reifyNode:node_modules/ignore Completed in 915ms 273 timing reifyNode:node_modules/functional-red-black-tree Completed in 915ms 274 timing reifyNode:node_modules/flat-cache Completed in 915ms 275 timing reifyNode:node_modules/deprecation Completed in 915ms 276 timing reifyNode:node_modules/chalk Completed in 915ms 277 timing reifyNode:node_modules/are-we-there-yet Completed in 915ms 278 timing reifyNode:node_modules/@babel/helper-validator-identifier Completed in 915ms 279 timing reifyNode:node_modules/is-arguments Completed in 921ms 280 timing reifyNode:node_modules/glob Completed in 921ms 281 timing reifyNode:node_modules/deep-is Completed in 922ms 282 timing reifyNode:node_modules/cross-spawn Completed in 922ms 283 timing reifyNode:node_modules/xml2js Completed in 930ms 284 timing reifyNode:node_modules/universal-user-agent Completed in 929ms 285 timing reifyNode:node_modules/json-schema-traverse Completed in 926ms 286 timing reifyNode:node_modules/is-map Completed in 927ms 287 timing reifyNode:node_modules/is-set Completed in 927ms 288 timing reifyNode:node_modules/emoji-regex Completed in 925ms 289 timing reifyNode:node_modules/define-properties Completed in 925ms 290 timing reifyNode:node_modules/before-after-hook Completed in 925ms 291 timing reifyNode:node_modules/triple-beam Completed in 933ms 292 timing reifyNode:node_modules/fast-deep-equal Completed in 930ms 293 timing reifyNode:node_modules/esutils Completed in 929ms 294 timing reifyNode:node_modules/prelude-ls Completed in 935ms 295 timing reifyNode:node_modules/picomatch Completed in 935ms 296 timing reifyNode:node_modules/iterate-iterator Completed in 934ms 297 timing reifyNode:node_modules/mime Completed in 934ms 298 timing reifyNode:node_modules/iterate-value Completed in 934ms 299 timing reifyNode:node_modules/is-regex Completed in 935ms 300 timing reifyNode:node_modules/is-string Completed in 935ms 301 timing reifyNode:node_modules/function-bind Completed in 934ms 302 timing reifyNode:node_modules/flatted Completed in 934ms 303 timing reifyNode:node_modules/express-winston Completed in 934ms 304 timing reifyNode:node_modules/fecha Completed in 935ms 305 timing reifyNode:node_modules/@octokit/plugin-request-log Completed in 933ms 306 timing reifyNode:node_modules/@octokit/request-error Completed in 933ms 307 timing reifyNode:node_modules/@octokit/rest Completed in 934ms 308 timing reifyNode:node_modules/rc Completed in 945ms 309 timing reifyNode:node_modules/object-keys Completed in 944ms 310 timing reifyNode:node_modules/is-date-object Completed in 942ms 311 timing reifyNode:node_modules/growl Completed in 943ms 312 timing reifyNode:node_modules/he Completed in 943ms 313 timing reifyNode:node_modules/debug Completed in 942ms 314 timing reifyNode:node_modules/braces Completed in 942ms 315 timing reifyNode:node_modules/mocha/node_modules/debug Completed in 949ms 316 timing reifyNode:node_modules/eslint/node_modules/debug Completed in 951ms 317 timing reifyNode:node_modules/@eslint/eslintrc/node_modules/debug Completed in 951ms 318 timing reifyNode:node_modules/text-table Completed in 959ms 319 timing reifyNode:node_modules/is-symbol Completed in 956ms 320 timing reifyNode:node_modules/espree Completed in 955ms 321 timing reifyNode:node_modules/depd Completed in 955ms 322 timing reifyNode:node_modules/doctrine Completed in 956ms 323 timing reifyNode:node_modules/body-parser Completed in 955ms 324 timing reifyNode:node_modules/chokidar Completed in 955ms 325 timing reifyNode:node_modules/is-callable Completed in 959ms 326 timing reifyNode:node_modules/json-stable-stringify-without-jsonify Completed in 962ms 327 timing reifyNode:node_modules/mime-db Completed in 962ms 328 timing reifyNode:node_modules/string.prototype.trimstart Completed in 968ms 329 timing reifyNode:node_modules/string.prototype.trimend Completed in 968ms 330 timing reifyNode:node_modules/npm-normalize-package-bin Completed in 966ms 331 timing reifyNode:node_modules/node-fetch Completed in 966ms 332 timing reifyNode:node_modules/send/node_modules/debug Completed in 979ms 333 timing reifyNode:node_modules/finalhandler/node_modules/debug Completed in 977ms 334 timing reifyNode:node_modules/fast-json-stable-stringify Completed in 977ms 335 timing reifyNode:node_modules/has-symbols Completed in 977ms 336 timing reifyNode:node_modules/express/node_modules/debug Completed in 977ms 337 timing reifyNode:node_modules/body-parser/node_modules/debug Completed in 984ms 338 timing reifyNode:node_modules/promise.allsettled Completed in 991ms 339 timing reifyNode:node_modules/eslint-scope Completed in 988ms 340 timing reifyNode:node_modules/@octokit/core Completed in 986ms 341 timing reifyNode:node_modules/@octokit/auth-token Completed in 987ms 342 timing reifyNode:node_modules/winston-transport Completed in 995ms 343 timing reifyNode:node_modules/sprintf-js Completed in 994ms 344 timing reifyNode:node_modules/regexpp Completed in 995ms 345 timing reifyNode:node_modules/es-to-primitive Completed in 991ms 346 timing reifyNode:node_modules/array.prototype.map Completed in 990ms 347 timing reifyNode:node_modules/object.assign Completed in 995ms 348 timing reifyNode:node_modules/minimist Completed in 994ms 349 timing reifyNode:node_modules/gauge Completed in 1007ms 350 timing reifyNode:node_modules/@octokit/graphql Completed in 1006ms 351 timing reifyNode:node_modules/type-fest Completed in 1014ms 352 timing reifyNode:node_modules/es-get-iterator Completed in 1009ms 353 timing reifyNode:node_modules/@octokit/request Completed in 1011ms 354 timing reifyNode:node_modules/esprima Completed in 1014ms 355 timing reifyNode:node_modules/eslint-utils Completed in 1016ms 356 timing reifyNode:node_modules/colors Completed in 1019ms 357 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 1034ms 358 timing auditReport:getReport Completed in 1036ms 359 timing reifyNode:node_modules/qs Completed in 1042ms 360 timing reifyNode:node_modules/@octokit/plugin-paginate-rest Completed in 1039ms 361 timing reifyNode:node_modules/express Completed in 1052ms 362 timing reifyNode:node_modules/winston-transport/node_modules/readable-stream Completed in 1064ms 363 timing reifyNode:node_modules/are-we-there-yet/node_modules/readable-stream Completed in 1069ms 364 timing reifyNode:node_modules/readable-stream Completed in 1078ms 365 timing reifyNode:node_modules/tar Completed in 1079ms 366 timing metavuln:cache:get:security-advisory:lodash:QfqeVpSKfkySSADJYMQTKymXBAczpJs/SekVCmE37hq8SBonO1nvomkBoqXEb2MLYW9M5P0TuZss2VLSdZFJUg== Completed in 52ms 367 timing metavuln:cache:get:security-advisory:ini:Ycq69/gaCzr/G/fbN43rDLIsHS7IdZHzW5bh0ju4uwHwvENyyzefC75bnxzsKQ1M+jh/75af+MnibiJLXd61Iw== Completed in 47ms 368 timing metavuln:cache:get:security-advisory:node-fetch:652S+/ar5yBvyi9sMNv+QgcE2qii5wVJ2M9hiyId6KkhVK7a776VAIL/mf6l0wkUESgoSKriuMsokTxRs6dH6g== Completed in 48ms 369 timing reifyNode:node_modules/eslint-plugin-mocha Completed in 1078ms 370 timing reifyNode:node_modules/object-inspect Completed in 1082ms 371 timing reifyNode:node_modules/bcrypt Completed in 1082ms 372 timing reifyNode:node_modules/argparse Completed in 1083ms 373 timing reifyNode:node_modules/iconv-lite Completed in 1090ms 374 timing reifyNode:node_modules/node-pre-gyp Completed in 1092ms 375 timing reifyNode:node_modules/@dabh/diagnostics Completed in 1088ms 376 timing reifyNode:node_modules/@eslint/eslintrc Completed in 1088ms 377 timing reifyNode:node_modules/@octokit/endpoint Completed in 1094ms 378 timing reifyNode:node_modules/esquery Completed in 1107ms 379 timing reifyNode:node_modules/semver Completed in 1116ms 380 timing reifyNode:node_modules/yargs-unparser/node_modules/yargs Completed in 1119ms 381 timing reifyNode:node_modules/xmlbuilder Completed in 1120ms 382 timing reifyNode:node_modules/needle Completed in 1125ms 383 timing reifyNode:node_modules/yargs Completed in 1129ms 384 timing reifyNode:node_modules/enquirer Completed in 1123ms 385 timing reifyNode:node_modules/diff Completed in 1123ms 386 timing reifyNode:node_modules/helmet Completed in 1128ms 387 timing reifyNode:node_modules/logform Completed in 1134ms 388 timing reifyNode:node_modules/mocha-multi-reporters Completed in 1136ms 389 timing reifyNode:node_modules/js-yaml Completed in 1149ms 390 timing reifyNode:node_modules/winston Completed in 1156ms 391 timing reifyNode:node_modules/workerpool Completed in 1158ms 392 timing reifyNode:node_modules/acorn Completed in 1152ms 393 timing reifyNode:node_modules/uri-js Completed in 1160ms 394 timing reifyNode:node_modules/@octokit/plugin-rest-endpoint-methods Completed in 1156ms 395 http fetch GET 304 https://registry.npmjs.org/lodash 130ms (from cache) 396 timing metavuln:packument:lodash Completed in 133ms 397 timing metavuln:load:security-advisory:lodash:1523 Completed in 2ms 398 timing metavuln:calculate:security-advisory:lodash:1523 Completed in 136ms 399 timing reifyNode:node_modules/table Completed in 1172ms 400 timing reifyNode:node_modules/@types/node Completed in 1185ms 401 timing reifyNode:node_modules/@octokit/types Completed in 1194ms 402 timing reifyNode:node_modules/node-addon-api Completed in 1200ms 403 timing reifyNode:node_modules/ajv Completed in 1237ms 404 http fetch GET 304 https://registry.npmjs.org/ini 209ms (from cache) 405 timing metavuln:packument:ini Completed in 210ms 406 timing metavuln:load:security-advisory:ini:1589 Completed in 0ms 407 timing metavuln:calculate:security-advisory:ini:1589 Completed in 211ms 408 http fetch GET 304 https://registry.npmjs.org/node-fetch 226ms (from cache) 409 timing metavuln:packument:node-fetch Completed in 227ms 410 timing metavuln:load:security-advisory:node-fetch:1556 Completed in 1ms 411 timing metavuln:calculate:security-advisory:node-fetch:1556 Completed in 229ms 412 timing reifyNode:node_modules/async Completed in 1271ms 413 http fetch GET 200 https://registry.npmjs.org/mocha-multi-reporters 13ms (from cache) 414 timing metavuln:packument:mocha-multi-reporters Completed in 14ms 415 timing metavuln:cache:get:security-advisory:table:BTtLgfcqn+leSf/UgazI50VICG2sYMlue9myg87gBELxUnCcyqeCimx2ALxH8DffkihWkDZdkI81M7Wf+PuPWg== Completed in 14ms 416 timing metavuln:cache:get:security-advisory:mocha-multi-reporters:wYA2JDENvCSBMe6JPVXnOxUdpRP3VdH1MMW0RPLxmsFcweQgP94xdAA659tXUbsoSytc+d+0e95+LSMpSJnElg== Completed in 15ms 417 timing metavuln:load:security-advisory:mocha-multi-reporters:QfqeVpSKfkySSADJYMQTKymXBAczpJs/SekVCmE37hq8SBonO1nvomkBoqXEb2MLYW9M5P0TuZss2VLSdZFJUg== Completed in 0ms 418 timing metavuln:calculate:security-advisory:mocha-multi-reporters:QfqeVpSKfkySSADJYMQTKymXBAczpJs/SekVCmE37hq8SBonO1nvomkBoqXEb2MLYW9M5P0TuZss2VLSdZFJUg== Completed in 15ms 419 timing reifyNode:node_modules/mocha Completed in 1330ms 420 http fetch GET 304 https://registry.npmjs.org/table 78ms (from cache) 421 timing metavuln:packument:table Completed in 79ms 422 timing metavuln:load:security-advisory:table:QfqeVpSKfkySSADJYMQTKymXBAczpJs/SekVCmE37hq8SBonO1nvomkBoqXEb2MLYW9M5P0TuZss2VLSdZFJUg== Completed in 0ms 423 timing metavuln:calculate:security-advisory:table:QfqeVpSKfkySSADJYMQTKymXBAczpJs/SekVCmE37hq8SBonO1nvomkBoqXEb2MLYW9M5P0TuZss2VLSdZFJUg== Completed in 79ms 424 timing metavuln:cache:get:security-advisory:@octokit/request:pUUD1Q+5xjJ43APcX2BfYMghS2SOX4jwSAi6IIBPoB11uDg0J4hZCtI8Pv2HhlAy9QZuI2xefAJnWUuSc1hT4g== Completed in 10ms 425 http fetch GET 304 https://registry.npmjs.org/@octokit%2frequest 111ms (from cache) 426 timing metavuln:packument:@octokit/request Completed in 113ms 427 timing metavuln:load:security-advisory:@octokit/request:652S+/ar5yBvyi9sMNv+QgcE2qii5wVJ2M9hiyId6KkhVK7a776VAIL/mf6l0wkUESgoSKriuMsokTxRs6dH6g== Completed in 0ms 428 timing metavuln:calculate:security-advisory:@octokit/request:652S+/ar5yBvyi9sMNv+QgcE2qii5wVJ2M9hiyId6KkhVK7a776VAIL/mf6l0wkUESgoSKriuMsokTxRs6dH6g== Completed in 113ms 429 timing metavuln:cache:get:security-advisory:rc:/2MFlZ/T1CPQQswjJhNhhlG4q5EG45VjjuYqMInN8sTOeP2ga8AcQhNm9qWbv2d5ZF/9iKyTNk1faKbtVHHNYg== Completed in 5ms 430 http fetch GET 304 https://registry.npmjs.org/rc 72ms (from cache) 431 timing metavuln:packument:rc Completed in 73ms 432 timing metavuln:load:security-advisory:rc:Ycq69/gaCzr/G/fbN43rDLIsHS7IdZHzW5bh0ju4uwHwvENyyzefC75bnxzsKQ1M+jh/75af+MnibiJLXd61Iw== Completed in 0ms 433 timing metavuln:calculate:security-advisory:rc:Ycq69/gaCzr/G/fbN43rDLIsHS7IdZHzW5bh0ju4uwHwvENyyzefC75bnxzsKQ1M+jh/75af+MnibiJLXd61Iw== Completed in 73ms 434 timing auditReport:init Completed in 505ms 435 timing reify:audit Completed in 1542ms 436 timing reifyNode:node_modules/eslint Completed in 1570ms 437 timing reifyNode:node_modules/ramda Completed in 1574ms 438 timing reifyNode:node_modules/es-abstract Completed in 1571ms 439 timing reifyNode:node_modules/@eslint/eslintrc/node_modules/lodash Completed in 1713ms 440 timing reifyNode:node_modules/eslint/node_modules/lodash Completed in 1715ms 441 timing reifyNode:node_modules/lodash Completed in 1717ms 442 timing reifyNode:node_modules/express-winston/node_modules/lodash Completed in 1716ms 443 timing reify:unpack Completed in 1724ms 444 timing reify:unretire Completed in 1ms 445 timing build:queue Completed in 4ms 446 timing build:link:node_modules/detect-libc Completed in 5ms 447 timing build:link:node_modules/node-pre-gyp/node_modules/semver Completed in 3ms 448 timing build:link:node_modules/he Completed in 3ms 449 timing build:link:node_modules/flat Completed in 3ms 450 timing build:link:node_modules/mime Completed in 3ms 451 timing build:link:node_modules/mkdirp Completed in 3ms 452 timing build:link:node_modules/node-pre-gyp Completed in 3ms 453 timing build:link:node_modules/nopt Completed in 3ms 454 timing build:link:node_modules/rc Completed in 3ms 455 timing build:link:node_modules/rimraf Completed in 3ms 456 timing build:link:node_modules/semver Completed in 3ms 457 timing build:link:node_modules/which Completed in 3ms 458 timing build:link:node_modules/esprima Completed in 4ms 459 timing build:link Completed in 5ms 460 info run bcrypt@5.0.0 install node_modules/bcrypt node-gyp rebuild 461 info run bcrypt@5.0.0 install { code: 1, signal: null } 462 timing reify:rollback:createSparse Completed in 503ms 463 timing reify:rollback:retireShallow Completed in 0ms 464 timing command:install Completed in 3247ms 465 verbose stack Error: command failed 465 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27) 465 verbose stack at ChildProcess.emit (node:events:376:20) 465 verbose stack at maybeClose (node:internal/child_process:1055:16) 465 verbose stack at Socket. (node:internal/child_process:441:11) 465 verbose stack at Socket.emit (node:events:376:20) 465 verbose stack at Pipe. (node:net:661:12) 466 verbose pkgid bcrypt@5.0.0 467 verbose cwd /Users/timja/code/jenkins/incrementals-publisher 468 verbose Darwin 20.2.0 469 verbose argv "/usr/local/Cellar/node/15.3.0/bin/node" "/usr/local/bin/npm" "install" 470 verbose node v15.3.0 471 verbose npm v7.5.2 472 error code 1 473 error path /Users/timja/code/jenkins/incrementals-publisher/node_modules/bcrypt 474 error command failed 475 error command sh -c node-gyp rebuild 476 error gyp info it worked if it ends with ok 476 error gyp info using node-gyp@7.1.2 476 error gyp info using node@15.3.0 | darwin | x64 476 error gyp info find Python using Python version 3.9.1 found at "/usr/local/opt/python@3.9/bin/python3.9" 476 error gyp info spawn /usr/local/opt/python@3.9/bin/python3.9 476 error gyp info spawn args [ 476 error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', 476 error gyp info spawn args 'binding.gyp', 476 error gyp info spawn args '-f', 476 error gyp info spawn args 'make', 476 error gyp info spawn args '-I', 476 error gyp info spawn args '/Users/timja/code/jenkins/incrementals-publisher/node_modules/bcrypt/build/config.gypi', 476 error gyp info spawn args '-I', 476 error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', 476 error gyp info spawn args '-I', 476 error gyp info spawn args '/Users/timja/Library/Caches/node-gyp/15.3.0/include/node/common.gypi', 476 error gyp info spawn args '-Dlibrary=shared_library', 476 error gyp info spawn args '-Dvisibility=default', 476 error gyp info spawn args '-Dnode_root_dir=/Users/timja/Library/Caches/node-gyp/15.3.0', 476 error gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', 476 error gyp info spawn args '-Dnode_lib_file=/Users/timja/Library/Caches/node-gyp/15.3.0/<(target_arch)/node.lib', 476 error gyp info spawn args '-Dmodule_root_dir=/Users/timja/code/jenkins/incrementals-publisher/node_modules/bcrypt', 476 error gyp info spawn args '-Dnode_engine=v8', 476 error gyp info spawn args '--depth=.', 476 error gyp info spawn args '--no-parallel', 476 error gyp info spawn args '--generator-output', 476 error gyp info spawn args 'build', 476 error gyp info spawn args '-Goutput_dir=.' 476 error gyp info spawn args ] 476 error gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp 476 error gyp ERR! configure error 476 error gyp ERR! stack Error: `gyp` failed with exit code: 1 476 error gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) 476 error gyp ERR! stack at ChildProcess.emit (node:events:376:20) 476 error gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12) 476 error gyp ERR! System Darwin 20.2.0 476 error gyp ERR! command "/usr/local/Cellar/node/15.3.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 476 error gyp ERR! cwd /Users/timja/code/jenkins/incrementals-publisher/node_modules/bcrypt 476 error gyp ERR! node -v v15.3.0 476 error gyp ERR! node-gyp -v v7.1.2 476 error gyp ERR! not ok 477 verbose exit 1 ```
recrsn commented 3 years ago

Looks like there is some issue where Node is running under Rosetta. I'll get hold of a M1 Mac and investigate further

hugo commented 3 years ago

I don't know if this is related, but I managed to get into a similarly broken state. As it turns out, I think this is user error not an issue with the bcrypt package itself. I realised that I had managed to get both the npm and install packages listed in my dependencies. (An easy typo which I think npm should prevent but that's another story.) Bumping npm from 7.5.2 to 7.5.4 (matching my currently installed version) and then running npm install fixed the issue. (Of course, the actual fix is to remove npm from my dependencies.) While in this case the mistake was me fat fingering a command, I wonder whether it's possible to get your package-lock.json into a similarly "broken" state with a less obvious cause?

Error message
npm ERR! code 1
npm ERR! path /Users/hugo/Sources/dashboard/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.15.5 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.1 found at "/usr/local/opt/python@3.9/bin/python3.9"
npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/hugo/.volta/tools/image/npm/7.5.4/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/hugo/Sources/dashboard/node_modules/bcrypt/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/hugo/.volta/tools/image/npm/7.5.4/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/hugo/Library/Caches/node-gyp/14.15.5/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/hugo/Library/Caches/node-gyp/14.15.5',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/hugo/.volta/tools/image/npm/7.5.4/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/hugo/Library/Caches/node-gyp/14.15.5/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/hugo/Sources/dashboard/node_modules/bcrypt',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/hugo/.volta/tools/image/npm/7.5.4/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Darwin 20.3.0
npm ERR! gyp ERR! command "/Users/hugo/.volta/tools/image/node/14.15.5/bin/node" "/Users/hugo/.volta/tools/image/npm/7.5.4/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/hugo/Sources/dashboard/node_modules/bcrypt
npm ERR! gyp ERR! node -v v14.15.5
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

macOS 11.2.1 Node v14.15.5 npm 7.5.4

racingrebel commented 3 years ago

I agree with you @hugo. All I did was a npm i some-other-package@latest (I was already on latest, but I was just double checking) and it changed my package-lock.json. That broke bcrypt when trying to install in Docker and showed the same error. I reverted my package-lock.json and it fixed the problem.

gugu commented 3 years ago

Regenerating package-lock helped. Here is the diff: image

dicktreichel commented 3 years ago

Same issue for me, apparently, as @gugu @hugo and @racingrebel - somehow a recent change to package-lock.json was causing this error:

npm ERR! code 1
npm ERR! path /Users/richardtreichel/nowsta/labor-market/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.3.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.5 found at "/usr/local/opt/python@3.9/bin/python3.9"
npm ERR! (node:57599) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/richardtreichel/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/richardtreichel/nowsta/labor-market/node_modules/bcrypt/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/richardtreichel/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/richardtreichel/Library/Caches/node-gyp/16.3.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/richardtreichel/Library/Caches/node-gyp/16.3.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/richardtreichel/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/richardtreichel/Library/Caches/node-gyp/16.3.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/richardtreichel/nowsta/labor-market/node_modules/bcrypt',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/richardtreichel/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 19.6.0
npm ERR! gyp ERR! command "/Users/richardtreichel/.nvm/versions/node/v16.3.0/bin/node" "/Users/richardtreichel/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/richardtreichel/nowsta/labor-market/node_modules/bcrypt
npm ERR! gyp ERR! node -v v16.3.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/richardtreichel/.npm/_logs/2021-06-24T02_04_31_222Z-debug.log

Thanks for the suggestion to regenerate package.json, worked for me!

zhonggithub commented 2 years ago

same issue for me

npm ERR! code 1 npm ERR! path /Users/zz/workspace/run_he/rh-console-server/node_modules/bcrypt npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@8.4.1 npm ERR! gyp info using node@16.14.2 | darwin | x64 npm ERR! gyp info find Python using Python version 3.9.12 found at "/usr/local/opt/python@3.9/bin/python3.9" npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/zz/workspace/run_he/rh-console-server/node_modules/bcrypt/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/zz/Library/Caches/node-gyp/16.14.2/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/zz/Library/Caches/node-gyp/16.14.2', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/zz/Library/Caches/node-gyp/16.14.2/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/zz/workspace/run_he/rh-console-server/node_modules/bcrypt', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:259:16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:526:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Darwin 21.4.0 npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /Users/zz/workspace/run_he/rh-console-server/node_modules/bcrypt npm ERR! gyp ERR! node -v v16.14.2 npm ERR! gyp ERR! node-gyp -v v8.4.1 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! /Users/zz/.npm/_logs/2022-04-10T01_57_56_379Z-debug-0.log