react-component / slider

React Slider
https://slider.react-component.now.sh/
MIT License
3.02k stars 763 forks source link

Windows: Cannot install v10.3.0 w/ Yarn in nodeLinker: node-modules mode #946

Closed rhullah closed 8 months ago

rhullah commented 9 months ago

With the release of v10.3.0, the dist folder includes a bunch of demo files that wasn't there in the previous version. Specifically the ~demos folder fails to install on Windows when using Yarn in nodeLinker: node-modules mode. It looks like it happens when it's attempting to copy a folder named :id. I assume it's because of the colon.

Are these demo files/folders needed in the distribution of the package, or could they be removed in order to not have this issue?

Lemmmy commented 8 months ago

With the release of ant-design v5.10.1, this is issue has now escalated to antd. This commit introduced the update: https://github.com/ant-design/ant-design/commit/05878dd300a43bb9f0b99c84bceeb78b8cbb0b6f#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R147

Reproduction steps:

  1. Initialize a Yarn 2 module: yarn init -2 -y
  2. Disable PnP: yarn config set nodeLinker node-modules
  3. Run yarn add antd

Error:

➤ YN0000: ┌ Link step
➤ YN0001: │ Error: While persisting /C:/Users/drew/Projects/antd-test-2/.yarn/cache/rc-slider-npm-10.3.0-594eded9f6-7e39f7d094.zip/node_modules/rc-slider/ -> /C:/Users/drew/Projects/antd-test-2/node_modules/rc-slider ENOENT: no such file or directory, mkdir 'C:\Users\drew\Projects\antd-test-2\node_modules\rc-slider\dist\~demos\:id'
➤ YN0000: └ Completed in 1s 133ms
➤ YN0000: Failed with errors in 4s 210ms

As mentioned above, the colon character (:) is invalid on Windows (it is used by NTFS Alternate Data Streams). You can test this with the following PowerShell:

# Works:
New-Item -ItemType Directory 'node_modules\rc-slider\dist\~demos'

# Doesn't work:
New-Item -ItemType Directory 'node_modules\rc-slider\dist\~demos\:id'

Due to this issue it is no longer possible to update antd on Windows on Yarn 2 with PnP disabled.

Edit: I think I've narrowed the problem down to this commit: https://github.com/react-component/slider/commit/2c477083c82396f3a0470660defc7f7e16bf09cf

yoyo837 commented 8 months ago

Close by https://github.com/react-component/slider/pull/947

yoyo837 commented 8 months ago

https://github.com/react-component/slider/releases/tag/v10.3.1

Lemmmy commented 8 months ago

Thanks for the incredibly quick fix!