"start":"set NODE_OPTIONS=--openssl-legacy-provider && ng serve -o"
核心代码
针对 Vue.js 拦截 createHash() 调用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
const crypto = require('crypto');
/** * The MD4 algorithm is not available anymore in Node.js 17+ (because of library SSL 3). * In that case, silently replace MD4 by the MD5 algorithm. */ try { crypto.createHash('md4'); } catch (e) { console.warn('Crypto "MD4" is not supported anymore by this Node.js version'); const origCreateHash = crypto.createHash; crypto.createHash = (alg, opts) => { returnorigCreateHash(alg === 'md4' ? 'md5' : alg, opts); }; }