gulp cannot find semantic.json during installation of semantic-ui
Asked Answered
T

2

7

I'm trying to install semantic-ui using npm and gulp using this tutorial: http://www.semantic-ui.com/introduction/getting-started.html

I run npm install semantic-ui --save and everything's fine. but then I direct into semantic/ folder and run gulp build but is says:

cannot find semantic.json. Run "gulp install" to set-up Semantic

the semantic.json file is on the root of my project. I also tried gulp install but it says Task 'install' is not in your gulpfile

what should I do?

EDIT: this is my gulpfile.js file:

/*******************************
            Set-up
*******************************/

var
  gulp         = require('gulp-help')(require('gulp')),

  // read user config to know what task to load
  config       = require('./tasks/config/user'),

  // watch changes
  watch        = require('./tasks/watch'),

  // build all files
  build        = require('./tasks/build'),
  buildJS      = require('./tasks/build/javascript'),
  buildCSS     = require('./tasks/build/css'),
  buildAssets  = require('./tasks/build/assets'),

  // utility
  clean        = require('./tasks/clean'),
  version      = require('./tasks/version'),

  // docs tasks
  serveDocs    = require('./tasks/docs/serve'),
  buildDocs    = require('./tasks/docs/build'),

  // rtl
  buildRTL     = require('./tasks/rtl/build'),
  watchRTL     = require('./tasks/rtl/watch')
;


/*******************************
             Tasks
*******************************/

gulp.task('default', false, [
  'watch'
]);

gulp.task('watch', 'Watch for site/theme changes', watch);

gulp.task('build', 'Builds all files from source', build);
gulp.task('build-javascript', 'Builds all javascript from source', buildJS);
gulp.task('build-css', 'Builds all css from source', buildCSS);
gulp.task('build-assets', 'Copies all assets from source', buildAssets);

gulp.task('clean', 'Clean dist folder', clean);
gulp.task('version', 'Displays current version of Semantic', version);

/*--------------
      Docs
---------------*/

/*
  Lets you serve files to a local documentation instance
  https://github.com/Semantic-Org/Semantic-UI-Docs/
*/

gulp.task('serve-docs', 'Serve file changes to SUI Docs', serveDocs);
gulp.task('build-docs', 'Build all files and add to SUI Docs', buildDocs);


/*--------------
      RTL
---------------*/

if(config.rtl) {
  gulp.task('watch-rtl', 'Build all files as RTL', watchRTL);
  gulp.task('build-rtl', 'Watch files as RTL ', buildRTL);
}
Trichinopoly answered 3/7, 2015 at 21:43 Comment(6)
what are you trying to do? are you running gulp build from npm_modules/semantic? also add your gulpfile.js so we can assistGeomorphology
I'm trying to install and use semantic-ui in a project. I'm running gulp build from myproject/semanticTrichinopoly
are you trying to add semantic-ui to your existing project?Geomorphology
yes, I'm adding it to an existing django projectTrichinopoly
iv'e tried to do npm install semantic-ui and i see what you meant. have you considered using bower?Geomorphology
can I use bower on windows?Trichinopoly
A
6

This problem happens when the node_modules is located in the upstream or different folder. Let's say you install the semantic-ui globally and the node_modules is located in:

/Users/afshin/node_modules/

All you need to address this issue is to copy the node_modules to the semantic-ui folder (your semantic-ui project folder)

Hope this save someone from a headache.

Armagnac answered 7/8, 2015 at 15:19 Comment(2)
I lost you, where to copy the node_modules from?Ovine
@JikkuJose you can find the node_modules in upstream folders.Armagnac
G
4

I run npm install semantic-ui --save and everything's fine. but then I direct into semantic/ folder and run gulp build ...

iv'e tried to follow up your lead and executed npm install semantic-ui

i got this annoying wizard:

enter image description here

Why not bower?

Since all you care about is to referencing semantic-ui's static files, i suggest using bower

install bower:

npm install -g bower

then add semantic-ui:

bower install semantic-ui


The semantic-ui package includes a dist directory contains a build of js + css ready to use

Geomorphology answered 3/7, 2015 at 22:31 Comment(1)
I tried to use gulp because it has an update command. Can I update my semantic-ui with bower too?Trichinopoly

© 2022 - 2024 — McMap. All rights reserved.