C:\Users\else\Downloads\chrome-extension>yarn run start
yarn run v1.22.22
$ node utils/webserver.js
i 「wds」: Project is running at http://localhost:3000/
i 「wds」: webpack output is served from undefined
i 「wds」: Content not from webpack is served from C:\Users\else\Downloads\chrome-extension\build
node:internal/crypto/hash:79
this[kHandle] = new _Hash(algorithm, xofLen, algorithmId, getHashCache());
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:79:19)
at Object.createHash (node:crypto:139:10)
at module.exports (C:\Users\else\Downloads\chrome-extension\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\else\Downloads\chrome-extension\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\Users\else\Downloads\chrome-extension\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\Users\else\Downloads\chrome-extension\node_modules\webpack\lib\NormalModule.js:503:5
at C:\Users\else\Downloads\chrome-extension\node_modules\webpack\lib\NormalModule.js:358:12
at C:\Users\else\Downloads\chrome-extension\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\else\Downloads\chrome-extension\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at Array. (C:\Users\else\Downloads\chrome-extension\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (C:\Users\else\Downloads\chrome-extension\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:43:16)
at C:\Users\else\Downloads\chrome-extension\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:79:9
at C:\Users\else\Downloads\chrome-extension\node_modules\graceful-fs\graceful-fs.js:90:16
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3) {
opensslErrorStack: [
'error:03000086:digital envelope routines::initialization error',
'error:0308010C:digital envelope routines::unsupported'
],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v22.17.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
C:\Users\else\Downloads\chrome-extension>
Assistant
Okay, this error is a common one, especially on Windows, and it's related to OpenSSL and Node.js. Here's a breakdown of the problem and how to fix it, along with explanations:
Understanding the Error
error:0308010C:digital envelope routines::unsupported: This error message indicates that Node.js is trying to use OpenSSL for cryptographic operations, but the version of OpenSSL it's finding is either too old, not configured correctly, or doesn't support the algorithms Node.js needs. Specifically, it's a problem with the "digital envelope routines" part of OpenSSL.
Node.js v22.17.0: The error is happening in Node.js version 22.17.0. Newer Node.js versions (especially v18 and later) have stricter requirements for OpenSSL.
Webpack: The error is triggered during the Webpack build process, which is part of your Chrome extension's development setup. Webpack uses cryptographic hashes for things like module caching and integrity checks.
Common Causes
Missing or Incompatible OpenSSL Installation: You might not have OpenSSL installed on your system, or the version you have is too old.
Node.js Build Configuration: Node.js needs to be built with OpenSSL support. Sometimes, pre-built Node.js binaries don't include it, or they're linked to the wrong OpenSSL library.
Environment Variables: Incorrectly set environment variables can prevent Node.js from finding the OpenSSL libraries.
Conflicting Libraries: Other software on your system might be interfering with OpenSSL.
Solutions
Here's a series of solutions, starting with the easiest and most common fixes. Try them in order:
1. Reinstall Node.js (Recommended)
This is often the simplest and most effective solution. Download the latest LTS (Long Term Support) version of Node.js from the official website: https://nodejs.org/
Important: During the installation process, make sure the installer adds Node.js to your PATH. This is usually a checkbox option.
Restart your computer after the installation. This ensures that the new Node.js version and its associated environment variables are loaded correctly.
Install OpenSSL: Run the installer. Pay attention to the installation directory (e.g., C:\OpenSSL-Win64).
Set Environment Variables: This is crucial. You need to tell Windows where to find the OpenSSL libraries.
Search for "Environment Variables" in the Windows search bar and open "Edit the system environment variables."
Click the "Environment Variables..." button.
In the "System variables" section (not the "User variables" section), find the "Path" variable and select it. Click "Edit...".
Click "New" and add the following paths (adjust if your OpenSSL installation directory is different):
C:\OpenSSL-Win64\bin
C:\OpenSSL-Win64\lib
Click "OK" on all the Environment Variables windows.
Restart your computer after setting the environment variables.
3. Set NODE_OPENSSL_CONFIG Environment Variable (Less Common, But Sometimes Helps)
This variable tells Node.js where to find the OpenSSL configuration file.
Follow the steps in "Set Environment Variables" above.
In the "System variables" section, click "New...".
Variable name: NODE_OPENSSL_CONFIG
Variable value: The path to your OpenSSL configuration file. This is usually something like C:\OpenSSL-Win64\openssl.cnf. (Adjust the path if your OpenSSL installation directory is different).
Click "OK" on all the Environment Variables windows.
Restart your computer.
4. Try a Different Node.js Version (If Nothing Else Works)
Sometimes, a specific Node.js version might have compatibility issues with your system. Try downgrading to an older LTS version (e.g., Node.js 18) or upgrading to the latest stable version. Use nvm (Node Version Manager) to easily switch between Node.js versions: https://github.com/coreybutler/nvm-windows
5. Check for Conflicting Software
Rarely, other software on your system might be interfering with OpenSSL. If you have any security software or VPNs installed, try temporarily disabling them to see if that resolves the issue.
After Trying a Solution
After trying each solution, restart your computer and then try running yarn run start again.
Debugging Steps (If the Problem Persists)
Verify OpenSSL Installation: Open a command prompt and type openssl version. If OpenSSL is installed correctly, it should display the version number.
Check Environment Variables: Open a command prompt and type echo %PATH%. Make sure the OpenSSL bin and lib directories are included in the output.
Examine the Full Error Log: The error message you posted is a snippet. Look for the complete error log in the console output. It might contain more clues about the problem.
In your specific case:
Given that you're working on a Chrome extension, it's highly likely that reinstalling Node.js (option 1) will fix the problem. The fact that the error occurs during the Webpack build suggests that the Node.js environment isn't set up correctly to handle the cryptographic operations that Webpack needs.
Let me know if you try these steps and if you still encounter the error. Provide any additional information about your system (Windows version, OpenSSL installation details, etc.), and I'll do my best to help you further.