Bin/ember-cli complains about node 18.18.1

I’m trying to run my development install on my Linux laptop.

I have a script that gets versions for Ruby, imagemagick, and nodejs from discourse_docker and sets them with asdf. Here’s a piece of it:

  RUBY_VERSION=$(grep  "^ARG RUBY_VERSION" $DISCOURSE_DOCKER_SRC/image/base/slim.Dockerfile |cut -d'=' -f2)
  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)
  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

But when I run bin/ember-cli I get this:

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 is the version in Discourse. Why do I need a different version for development than Discourse is running?

When I update to 18.18.0 and then run ember-cli I get a “SyntaxError: Unexpected token in JSON at position 219260” . . . something I can’t quite make sense of.

Now what do I try?

Is there some reliable way to see that my development environment is appropriate for doing development? It seems that once a month I spend an hour or more trying to make my development system work at all. Do people (like @sam and @falco) really use the docker development environment? Maybe I should target that container to get versions of Ruby and Node?

I always go with the latest LTS for NodeJS via ASDF.

I do not run my dev env on Docker.

I can see how it may be easier for complete newbies, but would be too troublesome for my personal preferences.

1 Like

Awesome. That makes sense. I guess it’s updated infrequently enough that you do it by hand.

I’ll give that a try tomorrow.

That’s how we’re the same. :wink:

1 Like

Great! Using Node 20.9.0 makes my development build work again. I’m a bit confused why that version would work and the version in the Discourse container would not, and wonder how things will work in the container with 18.whatever when it’s failing on my dev setup, but I guess I’ll see what happens.

Thanks for your help.