2024年3月

报错:

Access to XMLHttpRequest at XXXXX from origin XXXXXXX has been blocked
by CORS policy: The request client is not a secure context and the
resource is in more-private address space XXXX.

解决办法:

chrome://flags/#block-insecure-private-network-requests

设置为 Disabled

启动VUE项目报错:

opensslErrorStack: [ 'error:03000086:digital envelope
routines::initialization error' ], library: 'digital envelope
routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'

原因:NodeJS版本过高

解决方案:

1、降级NodeJS到合适的版本

2、临时设置 NODE_OPTIONS 环境变量 openssl-legacy-provider 选项,兼容OpenSSL旧版程序。

命令行执行:

Windows

$env:NODE_OPTIONS="--openssl-legacy-provider" npm run dev

Linux / Mac

NODE_OPTIONS=--openssl-legacy-provider npm run dev