Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Apr 19, 2023 · 4 comments

Comments

@sebababi
Copy link

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
Copy link
Member

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
Copy link

Hohuda commented Jul 22, 2023

I have same error and get it becase

  • stable@0.1.8 is a dependency of svgo@2.8.0
  • svgo@2.8.0 is a dependency of postcss-svgo@5.1.0(postcss@8.4.27)
  • postcss-svgo@5.1.0(postcss@8.4.27) is a dependency of cssnano-preset-default@5.2.14(postcss@8.4.27)
  • cssnano-preset-default@5.2.14(postcss@8.4.27) is a dependency of cssnano@5.1.15(postcss@8.4.27)
  • cssnano@5.1.15(postcss@8.4.27) is a dependency of rollup-plugin-postcss@4.0.2(postcss@8.4.27)(ts-node@10.9.1)
  • rollup-plugin-postcss@4.0.2(postcss@8.4.27)(ts-node@10.9.1) is a dependency of @nx/rollup@16.5.5(@babel/core@7.22.9)(@swc/core@1.3.70)(nx@16.5.5)(ts-node@10.9.1)(typescript@5.1.6)

@Hohuda
Copy link

Hohuda commented Jul 22, 2023

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
Copy link

Marcos436 commented Feb 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants