nrwl / nx-labs

A collection of Nx plugins
MIT License
143 stars 50 forks source link

Error: npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. #221

Open sebababi opened 1 year ago

sebababi commented 1 year ago

I try to install the latest standalone project in a folder called: pwa and I get this error. Basically, since I get the error it stops and doesn't create anything at tall, so non of the files, hence no packages.json so I cannot delete or remove "stable" from it.

STEP BY STEP:

(base) MacBook-Pro:pwa sebba$ npx create-nx-workspace@latest pwa --present=react-standalone Need to install the following packages: create-nx-workspace@15.9.2 Ok to proceed? (y) y

NX Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Choose what to create · react ✔ Bundler to be used to build the application · vite ✔ Default stylesheet format · scss xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun ✔ Enable distributed caching to make your CI faster · Yes

NX Nx is creating your v15.9.2 workspace.

To make sure the command works reliably in all environments, and that the preset is applied correctly, Nx will run "npm install" several times. Please wait.

✔ Installing dependencies with npm ✖ Creating your workspace in pwa

NX Nx failed to create a workspace.

Error: npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility

(base) MacBook-Pro:pwa sebba$ rm -rf pwa (base) MacBook-Pro:pwa sebba$ npx create-nx-workspace@latest pwa --present=react-standalone

mandarini commented 1 year ago

Hello! Thanks for filing an issue. Unfortunately, I could not reproduce. By the way, the correct command is:

npx create-nx-workspace@latest pwa --preset=react-standalone

I see you are getting a xcrun error. This error occurs when the Xcode Command Line Tools are not installed or properly configured on your macOS system. To fix this issue, follow these steps:

  1. Install Xcode Command Line Tools: Open Terminal and run the following command to install the Xcode Command Line Tools:
    xcode-select --install

A pop-up window will appear, prompting you to confirm the installation. Click "Install" and wait for the installation to complete.

  1. Reset the active developer directory: In some cases, you might still encounter the error after installing the Command Line Tools. To resolve this, you can reset the active developer directory path. Run the following command in Terminal:
sudo xcode-select --reset

Enter your password when prompted. This command resets the active developer directory to the default path.

  1. Set the active developer directory (if necessary): If the error still persists after resetting, you can manually set the active developer directory. Run the following command in Terminal:
sudo xcode-select -s /Library/Developer/CommandLineTools

This command sets the active developer directory to the Command Line Tools installation path.

After completing these steps, the error should be resolved.

Let me know if your error persists after you do this fix!

Hohuda commented 1 year ago

I have same error and get it becase

Hohuda commented 1 year ago

In the same way I get similar error deprecated sourcemap-codec@1.4.8

And it's a deep dependency of @nx/rollup@16.5.5 as well.

Marcos436 commented 8 months ago

e uma depedencia da arvore de depedencias de alguns pacote no meu caso e do react-scripts

─┬ react-scripts@5.0.1 ├─┬ @svgr/webpack@5.5.0 │ └─┬ @svgr/plugin-svgo@5.5.0 │ └─┬ svgo@1.3.2 │ └── stable@0.1.8 └─┬ css-minimizer-webpack-plugin@3.4.1 └─┬ cssnano@5.1.15 └─┬ cssnano-preset-default@5.2.14 └─┬ postcss-svgo@5.1.0 └─┬ svgo@2.8.0 └── stable@0.1.8 deduped

deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility