#CLI newb question: how to update to Remix 2.x?

1 messages · Page 1 of 1 (latest)

slim relic
#

I've got a Remix app that I need to update to use React Router v7, and the first step listed in the docs says to update Remix to the latest version of v2 and activate future flags. However, the example command on the doc page is literally this:

npm install @remix-run/{dev,react,node,etc.}@2

That doesn't look like any NPM command format that I've seen in the past. However, trusting that whoever wrote the docs knew what they were doing, I executed it as listed. Sure enough, it failed. (Why it's written that way, I have no idea.)

As a CLI newb (perhaps terminal-phobe would be a more appropriate term; I can do basic stuff, but frankly the terminal intimidates me so I don't spend more time with it than is absolutely necessary), I wasn't completely sure how to proceed. I was able to intuit that it should probably be a series of separate install commands, and I got the following to work:

npm install @remix-run/dev@2
npm install @remix-run/react@2
npm install @remix-run/node@2

Are those the only three needed? Or are there others implied by the etc portion that I just don't know?

slim relic
#

Installed one more after looking in package.json:

npm install @remix-run/serve@2

Still hoping to get confirmation from someone more experienced re: if I'm missing anything.

crude yew
#

The bracket syntax is shell expansion for alternative strings. if you type echo @remix-run/{dev,react,node,etc.}@2 you will see what it does. The shell expansion happens before npm even runs, just like * expansion happens.

slim relic
crude yew
#

I think they intend you to grep remix-run package.json and see what all you have and list those. It will differ depending on what you're using.

slim relic
#

While that makes sense in hindsight, it's confusing when someone (like me) comes along who doesn't know how to interpret it. For some reason command line stuff is my Achilles heel. Having a more clear/direct explanation in that part of the docs—one that didn't assume so much about the reader's skill level—would have saved me a bit of time. I can't imagine that I'm the only one who's been thrown off by that part.