This question already has answers here:
Yarn global command not working
(13 answers)
Closed last year.
When I install expo it installs but it doesn't install. Here are the details about the issue.
I start off by typing:
yarn global add expo-cli#4
When it installs it says:
warning package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.13: The platform "linux" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.3.2: The platform "linux" is incompatible with this module.
info "fsevents#2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "expo-cli > xdl > #expo/dev-server > #expo/metro-config > metro-react-native-babel-transformer#0.59.0" has unmet peer dependency "#babel/core#*".
[4/4] Building fresh packages...
When I install expo using yarn I get:
Installed "expo-cli#4.12.0" with binaries:
- expo
- expo-cli
Done in 4.30s.
But when I type 'expo --version' I get:
Command 'expo' not found, did you mean:
command 'exo' from snap exoscale-cli (v1.22.2)
command 'expn' from deb sendmail-base (8.15.2-18)
command 'expr' from deb coreutils (8.30-3ubuntu2)
See 'snap info <snapname>' for additional versions.
Based on what you posted I'm assuming that the folder where yarn installs global node modules isn't in your path.
Try one of these:
Try installing globally with npm (which is probably in your path)
npm i -g expo-cli
Add yarn global folder to path:
echo PATH="$PATH:$(yarn global bin)" >> ~/.bash_profile
See this thread for more info: Yarn global command not working
1: Go to the terminal and first input this
export PATH=$PATH:~/.npm-global/bin
2: After this command and enter this one
source ~/.bash_profile
Related
I am running code in node 12. There are plans to upgrade, but this is not an option today. I am trying to do a yarn install but somewhere there is some dependency with a dependency of a dependency of camelcase 7.0.0 but, of course, this is not compatible with node 12. So I get
error camelcase#7.0.0: The engine "node" is incompatible with this module. Expected version ">=14.16". Got "12.22.12"
error Found incompatible module.
No yarn.lock is generated, so I can't see what is causing this. Is there a way to see what the yarn dependency tree would be before generating a yarn.lock?
I've tried the following:
% yarn why camelcase#7.0.0
yarn why v1.22.19
[1/4] π€ Why do we have the module "camelcase#7.0.0"...?
[2/4] π Initialising dependency graph...
[3/4] π Finding dependency...
error We couldn't find a match!
β¨ Done in 1.13s.
% yarn install
yarn install v1.22.19
[1/4] π Resolving packages...
[2/4] π Fetching packages...
error camelcase#7.0.0: The engine "node" is incompatible with this module. Expected version ">=14.16". Got "12.22.12"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
I am trying to create react app with npx and get the following error: error fork-ts-checker-webpack-plugin#1.5.0: The engine "yarn" is incompatible with this module. Expected version ">=1.0.0".
Any ideas what could be the source of the issue? any tips would be appreciated. Thanks!
npx create-react-app food
npx: installed 91 in 5.566s
Creating a new React app in /home/oren/m/code/food.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v0.16.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents#1.2.9: The platform "linux" is incompatible with this module.
info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
warning fsevents#2.0.7: The platform "linux" is incompatible with this module.
info "fsevents#2.0.7" is an optional dependency and failed compatibility check. Excluding it from installation.
error fork-ts-checker-webpack-plugin#1.5.0: The engine "yarn" is incompatible with this module. Expected version ">=1.0.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /home/oren/m/code/food has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting food/ from /home/oren/m/code
Done.
About my environment:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
$ uname -a
Linux oren 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
node -v
v12.8.0
npm -v
6.10.2
I have solved by installing latest version of Yarn.
- first uninstall version
- installed latest version npm install -g yarn
- removing yarn cache folder in the AppData folder has solved my issue C:\Users\test\AppData\Local\Yarn
Look at this line in the log error fork-ts-checker-webpack-plugin#1.5.0: The engine "yarn" is incompatible with this module. Expected version ">=1.0.0". It says your yarn version is not compatible. You have yarn v0.16.1 but it has to be above 1.0.0. Please try to update your yarn version.
If anyone else is struggling with this even after uninstalling/reinstalling yarn from npm, for me I actually had an old version of yarn installed outside of npm or another package manager, and I had to uninstall it from the Add or Remove Programs list in Windows.
I am trying to install Less and Less-watch-compiler with Yarn. But I get a command not found when I check the lessc version.
I have OSX 10.11.6 El Capitan
I installed Yarn using Homebrew. I have Yarn version 1.9.4.
Then I used:
yarn global add less
This resulted in:
yarn global v1.9.4
[1/4] π Resolving packages...
[2/4] π Fetching packages...
warning Pattern ["less#^3.8.1"] is trying to unpack in the same destination "/Users/jem/Library/Caches/Yarn/v2/npm-less-3.8.1-f31758598ef5a1930dd4caefa9e4340641e71e1d" as pattern ["less#^3.0.4"]. This could result in non-deterministic behavior, skipping.
[----------------------------------------------------------------------------] 0/83(node:1407) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[3/4] π Linking dependencies...
[4/4] π Building fresh packages...
success Installed "less#3.8.1" with binaries:
- lessc
β¨ Done in 1.51s.
Then I used Yarn to get less-watch-compiler. Using the command:
yarn global add less-watch-compiler
That resulted in:
yarn global v1.9.4
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[-----------------------------------------------------------------------------------] 0/83(node:1597) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[3/4] π Linking dependencies...
[4/4] π Building fresh packages...
success Installed "less-watch-compiler#1.11.3" with binaries:
- less-watch-compiler
β¨ Done in 1.27s.
After doing this I checked the version of less by typing
lessc βversion. The result is:
-bash: lessc: command not found
In my ~/Library/Caches/Yarn/v2 directory I can see:
npm-less-3.8.1-f31758598ef5a1930dd4caefa9e4340641e71e1d
npm-less-watch-compiler-1.11.3-eb1fc62423898fae48fde1bed4968bb81bf220f2
Iβm not sure if this means that Less was installed.
I saw this question: lessc: command not found
It says I should Export the location of lessc into the PATH. But I need to know where lessc is? But Iβm not sure if the above items in the Cache file are the ones I need. Iβve tried removing node, yarn and nvm from my machine. Iβve removed and reinstalled yarn. But I get the same results each time.
Also, on my machine is another program called less. It's a unix page reader. http://www.greenwoodsoftware.com/less/
This has made things confusing.
Iβm new to this, and Iβve reached a dead end. Any help is appreciated.
Edit: I also tried to install yarn with npm.
sudo npm i -g yarn
sudo npm i -g less
sudo npm i -g less-watch-compiler
That didn't work either.
Also, when I look for lessc or less-watch-compiler using
$ which lessc
I don't get a response.
On a fresh install of laravel 5.6 via composer
How I installed it:
composer create-project laravel/laravel
After installing I ran:
npm install
I get back:
npm notice created a lockfile as package-lock.json. You should commit this file. Up to date in 0.163s.
It does not create a node_modules folder.
If I try using yarn to install the dependencies using:
yarn install
I get back:
yarn install v1.3.2 info No lockfile found. Resolving packages... warning laravel-mix > img-loader > imagemin-mozjpeg > mozjpeg > bin-wrapper > download > gulp-decompress > gulp-util#3.0.8: gulp-util is deprecated - replace it, following the guidlines at https://medium.com/gulpjs/gulp-util-ca3b1f9fac5 | Fetching packages... info fsevents#1.1.3: The platform 'win32' is incompatible with this module. info "fsevents#1.1.3" is an optional dependency and failed compatability check. Excluding it from installation. Linking dependencies.... Building fresh packages... success Saved lockfile. Done in 35.38s
This creates a node_modules folder with only ".yarn-integrity' no modules.
The link to the medium page doesn't work, receive 404 so no luck there.
My node version is: "v8.9.4" and my yarn version is: 'v1.3.2'
Edit: This isn't a git issue. I'm not using git
running:
npm install --dev or npm install --only=dev
This installed the dependencies I needed. For whatever reason in laravel 5.6 all the dependencies are considered devDependencies in the package.json file.
package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.
Run the following command
git add -A
git commit -m "Commit package-lock.json"
git push -u origin master
Now re-run npm install
Just make sure you are in your project directory e.g
1) cd path/to/my_laravel_project
2) npm install
this because you are not in laravel root folder, when you create a project, at first you are not in folder you need to open your project folder and use
npm i
I'm trying to generate a jHipster project using yarn - https://jhipster.github.io/installation/
I installed Node from its website and yarn with brew.
yarn version 0.19.1
node version v7.5.0
OSX Sierra 10.12.3
When I run yarn global add generator-jhipster, I could see jhispter generator being copied to /Users/{username}/.config/yarn/global/node_modules/
my-mac:~ user$ yarn global add generator-jhipster
yarn global v0.19.1
warning No license field
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
[4/4] π Building fresh packages...
warning undefined has no binaries
warning No license field
β¨ Done in 30.68s.
As the next step, when I run yo jhipster, it cannot find jhipster. However, when I run yarn add generator-jhipster, yo can find jhipster from current folder. Not sure whats wrong with adding in global location.
my-mac:~ user$ echo $PATH
/usr/local/sbin:~/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/Cellar/node/7.5.0/bin:/Users/{user}/.config/yarn/global/node_modules/.bin
Will appreciate any help in identify whats going on or if there is any issue with latest yarn version.
my-mac:~ user$ yo jhipster
Error jhipster
You donβt seem to have a generator with the name βjhipsterβ installed.
I had the same problem and the cause was my laziness. I did not took time to read the notes of Local installation with Yarn documentation:
Note: if you have problem to use these tools globally, be sure you have $HOME/.config/yarn/global/node_modules/.bin in your path.
On Mac or Linux: export PATH="$PATH:$(yarn global bin):$HOME/.config/yarn/global/node_modules/.bin"
To fix this issue I needed to install yeoman globally with yarn.
yarn global add yo
I am using Ubuntu and I faced this issue too. Then I use sudo to add yo package
sudo yarn global add yo
Hope this will helpful to you.