我正在尝试在我的 Linux 笔记本电脑上运行开发安装。
我有一个脚本,它从 discourse_docker 获取 Ruby、imagemagick 和 nodejs 的版本,并使用 asdf 设置它们。这是其中的一部分:
RUBY_VERSION=$(grep “^ARG RUBY_VERSION” $DISCOURSE_DOCKER_SRC/image/base/slim.Dockerfile |cut -d'=' -f2)
echo “GOT RUBY VERSION!! $RUBY_VERSION”
asdf install ruby $RUBY_VERSION
asdf global ruby $RUBY_VERSION
IMAGE_MAGICK_VERSION=$(grep -e ^IMAGE_MAGICK_VERSION ~/src/discourse-repos/discourse_docker/image/base/install-imagemagick|cut -d'\"' -f2)
echo “GOT IMAGE_MAGICK_VERSION: $IMAGE_MAGICK_VERSION”
asdf install imagemagick $IMAGE_MAGICK_VERSION
asdf global imagemagick $IMAGE_MAGICK_VERSION
# 2023-04-24 debian and pop!os have different nodejs versions
NODE_VERSION=$(docker run discourse/base:release bash -c 'node --version'|cut -d'v' -f2)
#NODE_VERSION=$(grep node ~/src/discourse-repos/discourse/.tool-versions|awk '{print $2}')
echo “GOT NODEJS version: $NODE_VERSION”
asdf install nodejs $NODE_VERSION
asdf global nodejs $NODE_VERSION
但是当我运行 bin/ember-cli 时,我得到这个:
./bin/ember-cli
warning Resolution field “unset-value@2.0.1” is incompatible with requested version “unset-value@^1.0.0”
error ember-template-lint@6.0.0: The engine “node” is incompatible with this module. Expected version “^18.18.0 || ^20.9.0 || >=21.1.0”. Got “18.17.1”
error Found incompatible module.
18.17.1 是 Discourse 中的版本。为什么我需要一个与 Discourse 运行版本不同的开发版本?
当我更新到 18.18.0 然后运行 ember-cli 时,我得到一个“SyntaxError: Unexpected token in JSON at position 219260”。. . 我无法完全理解的东西。
现在该尝试什么?
有没有可靠的方法来查看我的开发环境是否适合进行开发?似乎我每个月都要花一个小时或更长时间来尝试让我的开发系统正常工作。人们(比如 @sam 和 @falco)真的在使用 docker 开发环境吗?也许我应该以那个容器为目标来获取 Ruby 和 Node 的版本?