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

Fomantic and yarn - install issues #386

Closed
etshy opened this issue Jan 11, 2019 · 21 comments
Closed

Fomantic and yarn - install issues #386

etshy opened this issue Jan 11, 2019 · 21 comments
Labels
type/build Anything related to the build process

Comments

@etshy
Copy link

etshy commented Jan 11, 2019

Bug Report

Steps to reproduce

  1. having an existing package.json with fomantic ui as dep
  2. lauch yarn install
  3. Error while building fomantic ui

Expected result

The installation have no problems

Actual result

error while building fomantic ui

Screenshot (when possible)

console screenshot

Version

fomantic : 2.7.1
yarn : 1.13.0

is fomantic not "compatible" with yarn ?

ps : I'm trying yarn because it's recommended to build Symfony assets.

@lubber-de
Copy link
Member

Less 1.3.3 is a bit old... Fomantic 2.7 needs less >=3.7

@etshy
Copy link
Author

etshy commented Jan 11, 2019

Any idea why yarn try to install this 1.3.3 version ?

My package.json doesn't specify any less version

{
  "name": "public",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "blazy": "^1.8.2",
    "dropzone": "^5.5.1",
    "fomantic-ui": "^2.7.1",
    "historyjs": "^1.8.0-b2",
    "jquery-ui": "^1.12.1"
  },
  "devDependencies": {
    "@symfony/webpack-encore": "^0.17.1",
    "node-sass": "^4.10.0",
    "sass-loader": "^6.0.7",
    "webpack": "^3.12.0",
    "webpack-notifier": "^1.7.0"
  }
}

Edit :

I also have a lot of warning about peer dep unmet (I don't have these problems with npm)

warning " > fomantic-ui@2.7.1" has unmet peer dependency "better-console@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "del@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "extend@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-autoprefixer@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-chmod@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-clean-css@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-clone@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-concat@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-concat-css@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-copy@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-dedupe@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-flatten@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-header@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-help@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-if@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-less@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-notify@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-plumber@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-print@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-rename@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-replace@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-rtlcss@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "gulp-uglify@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "map-stream@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "replace-ext@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "require-dot-file@*".
warning " > fomantic-ui@2.7.1" has unmet peer dependency "yamljs@*".

@lubber-de lubber-de added the type/build Anything related to the build process label Jan 12, 2019
@lubber-de
Copy link
Member

lubber-de commented Jan 12, 2019

Seems like yarn is not installing dependencies of dependencies. Maybe this thread yarnpkg/yarn#2763 and the proposed solutions (like editing the lock file) helps.
I am a bit confused because there is a merged PR in yarn related to the mentioned issue, so maybe you just have to update yarn (tbh I haven't tested this myself)
It's up to yarn to provide a working solution for that.

@etshy
Copy link
Author

etshy commented Jan 12, 2019

OK.
I installed yarn few weeks ago with the yarn windows installer I'll try to update to the latest version 1.13

Thanks.

Edit : Just see a npm show less return this : less@3.9.0 so it seems yarn is installing the right version.

Weird that the 1.3.3 verison is used, no ?

@lubber-de lubber-de added the tag/help-wanted Issues which need help to fix or implement label Jan 17, 2019
@mathieutu
Copy link

Hey, I've a problem too with yarn:

...
[12:55:23] Starting 'run setup'...
? Set-up Semantic UI (Use arrow keys)
❯ Automatic (Use default locations and all components) 
  Express (Set components and output folder) 
  Custom (Customize all src/dist values) [12:55:24] The following tasks did not complete: install, run setup
[12:55:24] Did you forget to signal async completion?

@y0hami
Copy link
Member

y0hami commented Feb 1, 2019

@mathieutu I just did some more research into this and figured out a way around the issue.

You can install the package and ignore the install script via the following command

$ yarn add fomantic-ui --ignore-scripts

This will of course not create your semantic.json or install directory so you must run the following command to run the install script

$ yarn --cwd node_modules/fomantic-ui run install

@mathieutu
Copy link

mathieutu commented Feb 1, 2019 via email

@lubber-de
Copy link
Member

@etshy @mathieutu
Was the hint by @hammy2899 helpful and solved your yarn installation issues?
Would be nice to get feedback and your experience with yarn, so we probably can add this to the getting started page (or link to a tutorial in case you consider to blog your experience 😉

@mathieutu
Copy link

@lubber-de Actually I'm sorry, but I was on a little react project so I switched to https://react.semantic-ui.com instead.

I think it could work, but I didn't test. 😕

@etshy
Copy link
Author

etshy commented Feb 11, 2019

I have my project set up with npm now.
I don't know if it could bring problem so I didn't try it yet.

@bartocc
Copy link
Contributor

bartocc commented Feb 19, 2019

@hammy2899 I've tested yarn add fomantic-ui --ignore-scripts and it does not suppress the has unmet peer dependency warnings.

I am not super familiar with peer deps, but the way I understand it, I believe fomantic-ui should not have a peerDependencies section in its package.json.

What do you reckon?

@y0hami
Copy link
Member

y0hami commented Feb 19, 2019

@bartocc I can see why they are there but personally I would remove them. I will have to do some testing before removing them however I don't think it would cause any issues but just to be on the safe side.

Could you post your full error log so I can see what exactly is wrong.

@bartocc
Copy link
Contributor

bartocc commented Feb 19, 2019

@y0hami
Copy link
Member

y0hami commented Feb 20, 2019

@bartocc Thanks for the repo 👍

I did some testing and it all seemed fine so I have created a PR which removes the peerDeps and refactors how the dependencies are defined, this should fix your issues.

@bartocc
Copy link
Contributor

bartocc commented Feb 20, 2019

awesome @hammy2899

@lubber-de
Copy link
Member

lubber-de commented Apr 4, 2019

Can we close this since 2.7.3 contains #501 by @hammy2899 ?
@bartocc Can you confirm the yarn install works using the latest FUI Version?

@y0hami
Copy link
Member

y0hami commented Apr 4, 2019

@lubber-de Just tested it and when using yarn add fomantic-ui --ignore-scripts it does work no errors!

@y0hami y0hami closed this as completed Apr 4, 2019
@y0hami y0hami removed the tag/help-wanted Issues which need help to fix or implement label Apr 4, 2019
@JamesYFC
Copy link

JamesYFC commented Jun 12, 2019

I'm trying to run the following commands as mentioned above to install fomantic-ui with yarn on node 10.16.0, win10:

...

You can install the package and ignore the install script via the following command

$ yarn add fomantic-ui --ignore-scripts

...

$ yarn --cwd node_modules/fomantic-ui run install

and my gulp install fails with this error:


yarn run v1.16.0
$ gulp install
[11:58:09] Using gulpfile C:\Projects\TESTTelemetry\create-react-app\rsg-telemetry\front\node_modules\fomantic-ui\gulpfile.js
[11:58:09] Starting 'install'...
[11:58:09] Starting 'run setup'...
[11:58:09] Finished 'run setup' after 1 ms
[11:58:09] Starting 'create install files'...
Auto-Installing (Without User Interaction)
------------------------------
[11:58:09] 'create install files' errored after 1.63 ms
[11:58:09] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:125:11)
    at Object.join (path.js:427:7)
    at C:\Projects\TESTTelemetry\create-react-app\rsg-telemetry\front\node_modules\fomantic-ui\tasks\install.js:273:28
    at taskWrapper (C:\Projects\TESTTelemetry\create-react-app\rsg-telemetry\front\node_modules\undertaker\lib\set-task.js:13:15)
    at bound (domain.js:402:14)
    at runBound (domain.js:415:12)
    at asyncRunner (C:\Projects\TESTTelemetry\create-react-app\rsg-telemetry\front\node_modules\async-done\index.js:55:18)
    at process._tickCallback (internal/process/next_tick.js:61:11)
[11:58:09] 'install' errored after 6.38 ms
error Command failed with exit code 1.

This is the line that the error message seems to point to in install.js, line 273:

// add project root to semantic root
installFolder = path.join(manager.root, answers.semanticRoot);

Any idea how to fix this?

@JamesYFC
Copy link

JamesYFC commented Jun 12, 2019

In the error logs, the console suggests that the install is being run in auto-install mode.

Looking at the autoInstall section of the script, it seems like in here (install.js, line 191-201) it's looking for a nonexistent "base" property in currentConfig, which is assigned by looking for a semantic.json, but that file hasn't been created yet because we ran yarn install with --ignore-scripts

gulp.task('run setup', function (callback) {

    // If auto-install is switched on, we skip the configuration section and simply reuse the configuration from semantic.json
    if (install.shouldAutoInstall()) {
      answers = {
        overwrite   : 'yes',
        install     : 'auto',
        useRoot     : true,
        // currentConfig is undefined?
        semanticRoot: currentConfig.base
      };
      callback();

@jeffrson
Copy link

jeffrson commented Oct 2, 2019

IMO, running with "--ignore-scripts" is not a solution but, at best, a workaround. Furthermore, if running this in a yarn workspace or by lerna there will be further issues.

Is there any reason this can't be fixed properly?

@jacobweber
Copy link

jacobweber commented Feb 12, 2020

If we do use this workaround, how do we run the installer script? I'm trying to follow these instructions to customize my theme.

EDIT: never mind; saw it above. yarn --cwd node_modules/fomantic-ui run install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/build Anything related to the build process
Projects
None yet
Development

No branches or pull requests

8 participants