Skip to main content

2 posts tagged with "code2art"

View All Tags

解决elm依赖下载失败的问题

· 4 min read
orange
programmer on jvm platform

最近在本地构建open-radiant项目.
该项目是JetBrains开源的一个项目, 用于生成AI艺术图片, 在线演示地址为: code2art
在构建的过程中遇到了一些问题.
其中的一个问题是当执行elm make时依赖下载失败, 日志如下:

Starting downloads...

● elm/json 1.1.3
● elm-community/list-extra 8.2.2
● elm/random 1.0.0
● elm/file 1.0.5
● elm/virtual-dom 1.0.2
● elm/parser 1.1.0
● rtfeldman/elm-iso8601-date-strings 1.1.3
● elm/url 1.0.0
● elm-community/random-extra 3.1.0
● elm-explorations/webgl 1.1.1
● elm/core 1.0.2
✗ elm/http 2.0.0
✗ owanturist/elm-union-find 1.0.0
✗ elm/bytes 1.0.8
✗ elm/svg 1.0.1
✗ avh4/elm-color 1.0.0
✗ elm/time 1.0.0
✗ elm-community/json-extra 4.2.0
✗ fredcy/elm-parseint 2.0.1
✗ noahzgordon/elm-color-extra 1.0.2
✗ elm/html 1.0.0
✗ elm/browser 1.0.2
✗ newlandsvalley/elm-binary-base64 1.0.3
✗ elm-community/easing-functions 2.0.0

Dependency problem!
-- PROBLEM DOWNLOADING PACKAGE -------------------------------------------------

I was trying to download the source code for avh4/elm-color 1.0.0, so I tried to
fetch:

https://github.com/avh4/elm-color/zipball/1.0.0/

But my HTTP library is giving me the following error message:

ConnectionTimeout

Are you somewhere with a slow internet connection? Or no internet? Does the link
I am trying to fetch work in your browser? Maybe the site is down? Does your
internet connection have a firewall that blocks certain domains? It is usually
something like that!

node.js v17及以上版本使用openssl v3.0引发的哈希算法错误及其解决方法

· 3 min read
orange
programmer on jvm platform

最近在本地构建open-radiant项目.
该项目是JetBrains开源的一个项目, 用于生成AI艺术图片, 在线演示地址为: code2art
在构建的过程中遇到了一些问题.

其中的一个问题是当执行npm start时报错, 相关错误信息如下:


> jb-animation-generator@1.0.0 start
> ./node_modules/.bin/webpack-dev-server --mode=development

ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/orange/Documents/Project/Github/open-radiant
node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/home/orange/Documents/Project/Github/open-radiant/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/home/orange/Documents/Project/Github/open-radiant/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/home/orange/Documents/Project/Github/open-radiant/node_modules/webpack/lib/NormalModule.js:471:10)
at /home/orange/Documents/Project/Github/open-radiant/node_modules/webpack/lib/NormalModule.js:503:5
at /home/orange/Documents/Project/Github/open-radiant/node_modules/webpack/lib/NormalModule.js:358:12
at /home/orange/Documents/Project/Github/open-radiant/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/home/orange/Documents/Project/Github/open-radiant/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at Array.<anonymous> (/home/orange/Documents/Project/Github/open-radiant/node_modules/loader-runner/lib/LoaderRunner.js:205:4) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.1

问题原因

经过网上的一番搜索, 发现这个问题是由于node.js的版本升级到v17及以上版本, 而openssl的版本升级到v3.0引起的.

openssl是一个开源的安全套接字层密码库, 用于提供加密和认证服务.
node.jsv17及以上版本中使用了opensslv3.0版本, 该版本中移除了一些哈希算法, 导致在使用这些算法时报错.

解决方案

这个问题的解决解决方案有以下几种:

  • 降低node.js的版本到v16及以下版本
  • npm start之前先执行export NODE_OPTIONS=--openssl-legacy-provider
    通过该环境变量可以启用openssllegacy provider,支持一些旧的哈希算法.
  • 升级相关依赖包到最新版本,可能会修复这个问题.

参考资料