-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm ERR! gyp: name 'openssl_fips' is not defined #2673
npm ERR! gyp: name 'openssl_fips' is not defined #2673
Comments
根据找到的资料在binding.gyp也添加了 ‘variables’:{'openssl_fips':0}
|
@cclauss 刚刚发现23天前我也像你们提过这个问题,但是貌似后续我解决了 ,当时是在windows上面。现在换了macos
|
node -v 16.14.0 |
之前通过很多尝试把问题修复了,但是我把node_module删除了 现在windows 也面临这个问题
|
I had the same issue with Node14. The version below node17 does not seem to match [email protected], downgrade node-gyp to version "v8.3.0", the issue is solved for me. |
Looking at https://github.com/nodejs/node-gyp/search?q=openssl_fips In
|
gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp |
I did not want to edit the binding.gyp file of a module that I was using. So I solved this problem by passing |
Does this solution solve all |
For my case yes. Had to make this change after updating node and npm to latest. |
When using The gyp source code location is printed in the error message:
gyp seems to evaluate the diff --git a/gyp/pylib/gyp/input.py b/gyp/pylib/gyp/input.py
index 354958b..bb982eb 100644
--- a/gyp/pylib/gyp/input.py
+++ b/gyp/pylib/gyp/input.py
@@ -1190,7 +1190,7 @@ def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, buil
else:
ast_code = compile(cond_expr_expanded, "<string>", "eval")
cached_conditions_asts[cond_expr_expanded] = ast_code
- env = {"__builtins__": {}, "v": StrictVersion}
+ env = {"__builtins__": {"openssl_fips": ""}, "v": StrictVersion}
if eval(ast_code, env, variables):
return true_dict
return false_dict The
|
Here facing same issue: yarn v1.22.19 Workaround above #2673 (comment) did work fine In addition I run both,
|
@2812848295 Can this issue be closed? |
This worked for me. Thank you |
Hi. On Linux, node 18.7.0, building electron 20.0.3 for Element Matrix, none of the suggested solutions work. |
* Pass openssl_fips as a variable to support building older node versions on newer node versions See nodejs/node-gyp#2534 and nodejs/node-gyp#2673 for more context on this issue * Update dependencies * Add support for Node.js 18 and 19 As node-pre-gyp is no longer maintained this is the path of least resistance to adding new versions, we include a patch within this project that updates the abi_crosswalk file within node-pre-gyp that is used to map the versions of node to their module/v8 versions. Then in run.js we call patch-package before spawning anything to ensure that our patches are applied correctly. This isn't by any means perfect but it's the quickest way to update the supported versions of node without having to go and make any major refactors to the setup here, or the code in ioslib/the SDK
The Electron version we’re currently using is on Node 13 (?) but this is a step forward to upgrading to a newer Electron and Node version. Updates etcher-sdk and switches the redundant aws4-axios dependency to just axios. Also changed bundler to stop trying to bundle wasm files — they must be included inline with JS code as data — and removed some now redundant code. The crucial changes that enable support are: 1. The update to etcher-sdk@8 where some dependency fixes and updates took place 2. The downgrade and pinning of "electron-rebuild" to v3.2.3 until we’re able to update to Electron >= 14.2. The patch we need to avoid is electron/rebuild#907. Also see: nodejs/node-gyp#2673 and electron/rebuild#913 Change-type: minor
The Electron version we’re currently using is on Node 13 (?) but this is a step forward to upgrading to a newer Electron and Node version. Updates etcher-sdk and switches the redundant aws4-axios dependency to just axios. Also changed bundler to stop trying to bundle wasm files — they must be included inline with JS code as data — and removed some now redundant code. The crucial changes that enable support are: 1. The update to etcher-sdk@8 where some dependency fixes and updates took place 2. The downgrade and pinning of "electron-rebuild" to v3.2.3 until we’re able to update to Electron >= 14.2. The patch we need to avoid is electron/rebuild#907. Also see: nodejs/node-gyp#2673 and electron/rebuild#913 3. A rule in webpack.config to ignore `aws-crt` which is a dependency of (ultimately) `aws4-axios` which is used by etcher-sdk and does a runtime check to its availability. We’re not currently using the “assume role” functionality (AFAIU) of aws4-axios and we don’t care that it’s not found, so force webpack to ignore the import. See aws/aws-sdk-js-v3#3025 Change-type: minor
The Electron version we’re currently using is on Node 13 (?) but this is a step forward to upgrading to a newer Electron and Node version. Updates etcher-sdk and switches the redundant aws4-axios dependency to just axios. Also changed bundler to stop trying to bundle wasm files — they must be included inline with JS code as data — and removed some now redundant code. The crucial changes that enable support are: 1. The update to etcher-sdk@8 where some dependency fixes and updates took place 2. The downgrade and pinning of "electron-rebuild" to v3.2.3 until we’re able to update to Electron >= 14.2. The patch we need to avoid is electron/rebuild#907. Also see: nodejs/node-gyp#2673 and electron/rebuild#913 3. A rule in webpack.config to ignore `aws-crt` which is a dependency of (ultimately) `aws4-axios` which is used by etcher-sdk and does a runtime check to its availability. We’re not currently using the “assume role” functionality (AFAIU) of aws4-axios and we don’t care that it’s not found, so force webpack to ignore the import. See aws/aws-sdk-js-v3#3025 Change-type: minor
The Electron version we’re currently using is on Node 14 but this is a step forward to upgrading to a newer Electron and Node version. Updates etcher-sdk and switches the redundant aws4-axios dependency to just axios. Also changed bundler to stop trying to bundle wasm files — they must be included inline with JS code as data — and removed some now redundant code. The crucial changes that enable support are: 1. The update to etcher-sdk@8 where some dependency fixes and updates took place 2. The downgrade and pinning of "electron-rebuild" to v3.2.3 until we’re able to update to Electron >= 14.2. The patch we need to avoid is electron/rebuild#907. Also see: nodejs/node-gyp#2673 and electron/rebuild#913 3. A rule in webpack.config to ignore `aws-crt` which is a dependency of (ultimately) `aws4-axios` which is used by etcher-sdk and does a runtime check to its availability. We’re not currently using the “assume role” functionality (AFAIU) of aws4-axios and we don’t care that it’s not found, so force webpack to ignore the import. See aws/aws-sdk-js-v3#3025 Change-type: minor
Fix this issue nodejs/node-gyp#2673 (comment)
For me, where the issue came from an electron project, upgrading electron and electron-builder to latest (23.1.4 and 23.6.0 respectively) solved the issue. |
For my case, it is only failed at npm start, so I run this to overcome: |
@arjunfulp You can avoid passing the flag in the npm config set openssl_fips '' |
@KernelPanic92 Not with up-to-date versions of npm.
|
I solved by upgrading electron and electron-builder to latest & using node v13.14.0 via nvm. I was building node-pty for using: |
Please do not advocate that others use long archived software or unsupported versions of Node.js. |
Solution: #2673 (comment)
• electron-builder version=22.14.13
• rebuilding native dependencies [email protected], [email protected] platform=darwin arch=arm64
⨯ cannot execute cause=exit status 1
errorOut=npm ERR! code 1
npm ERR! path /Users/wks/Desktop/electron/terrasync/node_modules/ffi-napi
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.8.9 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/wks/Desktop/electron/terrasync/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/wks/Desktop/electron/terrasync/node_modules/ffi-napi/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/wks/Desktop/electron/terrasync/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/wks/.electron-gyp/11.5.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/wks/.electron-gyp/11.5.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/wks/Desktop/electron/terrasync/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/wks/.electron-gyp/11.5.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/wks/Desktop/electron/terrasync/node_modules/ffi-napi',
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: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in ../node-addon-api/node_api.gyp while loading dependencies of 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: 1npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/Users/wks/Desktop/electron/terrasync/node_modules/node-gyp/lib/configure.js:261:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.5.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/wks/Desktop/electron/terrasync/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/wks/Desktop/electron/terrasync/node_modules/ffi-napi
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
┌────────────────────────────────────────────────────────┐$USER:$ (id -gn $USER) /Users/wks/.config │
│ electron-builder update check failed │
│ Try running with sudo or get access │
│ to the local update config store via │
│ sudo chown -R
└────────────────────────────────────────────────────────┘
npm ERR! code 1
npm ERR! path /Users/wks/Desktop/electron/terrasync
npm ERR! command failed
npm ERR! command sh -c electron-builder install-app-deps
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/wks/.npm/_logs/2022-06-01T07_14_16_686Z-debug-0.log
The text was updated successfully, but these errors were encountered: