design-system icon indicating copy to clipboard operation
design-system copied to clipboard

Migration Script Error

Open toddbrady opened this issue 2 years ago • 5 comments

Migration Script Error on Windows Running the migration script on Windows is returning an error, possibly a Node JS error.

To Reproduce Steps to reproduce the behavior:

  1. Install latest CMS Design System from NPM
  2. In the console run the following command: npx cmsds-migrate
  3. Select: react button-migration
  4. See error

Error

!! Error: inquireForFile: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data are supported by the default ESM loader. 
On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'

Expected behavior Help migrating the old Design System Buttons to the latest using 6.0+ of the Design System.

Windows laptop

  • Windows v10
  • Node v18.12.0

toddbrady avatar Apr 05 '23 14:04 toddbrady

Thanks for reporting this, @toddbrady. We're looking into this problem. It looks like Node expects a special prefix when importing ES modules by absolute paths on Windows because it doesn't quite understand roots like C:/. It wasn't something we tested for. If this is really time-sensitive and you have access to a UNIX machine, I suggest running it on that.

pwolfert avatar Apr 05 '23 23:04 pwolfert

Hey @toddbrady, are you able to run this in the WSL? We don't test or run any of our system in a windows environment.

forrestbaer avatar Apr 06 '23 13:04 forrestbaer

@forrestbaer Unfortunately not. The machine I have is fairly locked down. Outside of being able to run Git Bash, I don't have access to Linux.

toddbrady avatar Apr 06 '23 14:04 toddbrady

Bummer! Well since we don't have a windows environment to test in I'm hesitant to try to change something locally and hope it works for you. I will see about getting a windows license I can perhaps run in a VM, but in the meantime, if you'd like to work on this together I'd be happy to pair with you on your machine to adjust some things to see if we can get it working. You can PM me in slack user: BTZ8

Another option if you feel up to it would be to see if you can resolve the issue locally and submit a fix. The script and it's helpers are located in your node_modules/@cmgov/design-system@version/scripts/cmsds-migrate folder.

forrestbaer avatar Apr 06 '23 16:04 forrestbaer

Sure thing. Let me see what I can do in the next day or two. I'll see if I can modify the script directly in the npm package, and see what happens.

toddbrady avatar Apr 07 '23 01:04 toddbrady

Closing issue. This appears to have been resolved in #2099

zarahzachz avatar Jul 15 '24 18:07 zarahzachz