Cannot activate yarn - node.js

I'm following yarn installation doc. When I run corepack prepare yarn#stable --activate, I'm getting Usage Error: Invalid package manager specification in CLI arguments; expected a semver version. Anyone know what's up?

As per this github issue https://github.com/yarnpkg/berry/issues/4132, you should corepack enable instead of corepack prepare

Related

Strapi V4 Error: Can't resolve '#strapi/design-system/themes'

I'm trying to run the new Strapi version 4 application. But it returns this error.
Is there any bug in new strapi v4? or I'm doing wrong anything?
I'm using strapi official guide to start a new project
installation command npx create-strapi-app#latest molla-admin.
NodeJS v16
Windows 11
Error
ModuleNotFoundError: Module not found: Error: Can't resolve '#strapi/design-system/themes' in 'C:\Users\Admin\Desktop\molla-admin\.cache\admin\src'
at C:\Users\Admin\Desktop\molla-<anonymous>:10:1)
You might be thinking #strapi/design-system package is missing right? After that, I also tried to install both #strapi/design-system and #strapi/design-system/themes npm package
Still, it doesn't work. It returns a new error
ModuleNotFoundError: Module not found: Error: Can't resolve '#strapi/icons/CarretDown' in 'C:\Users\Admin\Documents\testing\strapi-v4-app\node_modules\#strapi\helper-plugin\build'
Should I go on for the next missing Module?
For me the issue was solved by installing #strapi/design-system (Node: v14.15.5, npm: 8.1.3)
npm install #strapi/design-system
Node version : 14.18.1
Npm version : 6.14.15
OS : Ubuntu 20.04.3 LTS
Steps I followed:
(I read somewhere that the latest version of node isnt working and
someone mentioned using the 14.18.1 version)
Downgraded NPM to use the 14.18.1 version and not the latest.
npm run build on the strapi project. This gave an error that its
missing #strapi/design-system.
npm install #strapi/design-system, you get another error that its missing #strapi/icons
npm install #strapi/icons . After this step there was an error relating to JSX scritps something to do with reactjs. So, in the next step , I updated Reactjs
npm install --save react#latest
npm run build again and this time SUCCESS!!
The strapi team should mention the issues on their homepage rather that making new users go through hoops to get it working. They need to make it clear that you can run into issues when using certain version of Node etc. As someone mentioned that they are aware of the issue yet no information in the homepage where new users visit to try it out. It should've been placed as a BANNER at the top in BOLD TEXT.
It's a known bug and they are working on a fix.
You have to use yarn in the mean time.
I can confirm that this bug is related to using Node v16. To get around the bug, I first ran:
nvm use 14.18.1
Afterwards, running the following resulted in successful compilation:
npm run build -- --clean
No need to attempt installation of #strapi/design-system.
I got this error because I was using Node v16. There was a message somewhere in my troubleshooting that you have to use A Node version >=10.X.X.X and <=14.X.X.X
I used NVM(Node Version Manager) to switch to 14.17.6 and it works
following solution worked for me:
yarn add #strapi/design-system
yarn add #strapi/icons
work on windows and ubuntu
node v14.15.0
yarn 1.22.17
npm 6.14.8
npm install #strapi/design-system
solution worked for me.
node 16.13.1
npm 8.1.4
macOS 12.0.1 on M1Max

Consequences of disabling check_yarn_integrity?

I see a common message when trying to start the rails server:
rails s
=> Booting Puma
=> Rails 6.0.3.2 application starting in development
=> Run `rails server --help` for more startup options
error Couldn't find an integrity file
error Found 1 errors.
========================================
Your Yarn packages are out of date!
Please run `yarn install --check-files` to update.
========================================
To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).
yarn check v1.22.10
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
I have tried for 2 days to fix this. Deleting node_modules and reinstalling, etc, but nothing I do has worked. So I am considering doing as the message suggests and disabling the yarn integrity check.
Question
What does this integrity check do, and should I be worried about disabling it?
Notes
Disabling this integrity check is suggested/recommended in a few places, including
https://github.com/rails/webpacker/issues/1374#issuecomment-495280789
Info
I reinstalled nvm, node and yarn just to eliminate possible causes of problems:
nvm -v
0.38.0
node -v
v16.0.0
npm -v
7.10.0
yarn -v
1.22.10
have you tried running the suggested command?
yarn install --check-files
you could also try reinstalling webpacker, which will create a new manifest file which will pass integrity checks:
rails webpacker:install
An update, the errors I was getting were very widespread, caused by a incompatibility with node 16 and a dependency (node-sass).
So rather than turn off the integrity check, I simply used nvm to downgrade to node 14

getting error while installing the yarn in react js project

$ yarn install
yarn install v1.19.1
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies cau
sed by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] Validating package.json...
error app#0.3.0: The engine "node" is incompatible with this module. Expected version ">=10.17.0". Got "10.15.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
getting the errors while installing the yarn in react js project
error app#0.3.0: The engine "node" is incompatible with this module. Expected version ">=10.17.0". Got "10.15.2"
error Found incompatible module.
Remove package-lock.json and run yarn install --ignore-engines
When working on a team, sometimes another dev installs it. One good way to avoid this happening is using package-locks-checks, which I wrote.
If you run npx package-locks-checks it will check for this kind of inconsistencies and avoid you to have issues on production environment.

Yarn ignore-engines for specific packages

When installing dependencies using yarn, one package (newrelic) gives the following error:
newrelic#5.6.2: The engine "node" is incompatible with this module. Expected version ">=6.0.0 <11.0.0". Got "11.13.0"
The only workaround to this I could find is to run
yarn install --ignore-engines
However, this would ignore engine mismatch across packages. Is there any way to ignore it only for a specific package?
There doesn't appear to be a way to provide package-specific flags on the install command.
However, you can try adding the problematic packages with the flag and followup with a normal install afterwards.
yarn add <problematic packages> --ignore-engines
yarn install
By default, unless --force is provided as a flag to yarn install, packages that already are installed will not be fetched again.

'global' file or directory not found for yarn

When I try to use any command using yarn global, like 'yarn global add yo', I get an error saying ERROR: [Errno 2] No such file or directory: 'global'.
Could not find matching solutions on the internet. Any help will be appreciated. Thanks!
A (alternative) solution:
When I installed yarn using Debian package repository, I got the error mentioned in the question while doing yarn global.
However, when I installed yarn using npm, like this:
npm install -g yarn
I did not get the error anymore upon doing yarn global. Any explanation or detailed answer addressing the issue with installation using Debian package repository is welcome.

Resources