Gulp - Can't launch gulp build
Recently I had to delete and re-download my project. So I had to re-install dependencies but when I tried to build the fomantic sources I got this error
> gulp build
D:\PhpStormProjects\bookuto\node_modules\gulp-help\index.js:81
task = gulp.tasks[name];
^
TypeError: Cannot read property 'help' of undefined
at Gulp.gulp.task (D:\PhpStormProjects\bookuto\node_modules\gulp-help\index.js:81:22)
at module.exports (D:\PhpStormProjects\bookuto\node_modules\gulp-help\index.js:97:8)
at Object.<anonymous> (D:\PhpStormProjects\bookuto\assets\semantic\gulpfile.js:6:38)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
result from gulp -v
D:\PhpStormProjects\bookuto\assets\semantic>gulp -v
[21:53:21] CLI version 2.0.1
[21:53:21] Local version 4.0.0
results from node -v
> node -v
v10.12.0
fomantic version : 2.6.4
This is possibly due to you using gulp4, Try running npx gulp build and see if that fixes it.
nope, it didn't work.
It asked me to install gulp locally inside my semantic folder, I did it and then with th command you proposed, I had the same error as before
>npx gulp build
D:\PhpStormProjects\bookuto\node_modules\gulp-help\index.js:81
task = gulp.tasks[name];
^
TypeError: Cannot read property 'help' of undefined
at Gulp.gulp.task (D:\PhpStormProjects\bookuto\node_modules\gulp-help\index.js:81:22)
at module.exports (D:\PhpStormProjects\bookuto\node_modules\gulp-help\index.js:97:8)
at Object.<anonymous> (D:\PhpStormProjects\bookuto\assets\semantic\gulpfile.js:6:38)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
More information I forgot to add.
I'm in a symfony app, so my semantic folder is in assets/semantic
my semantic.json is like this
{
"base": "assets\\semantic\\",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "src/themes/"
},
"output": {
"packaged": "dist/",
"uncompressed": "dist/components/",
"compressed": "dist/components/",
"themes": "dist/themes/"
},
"clean": "dist/"
},
"permission": false,
"autoInstall": false,
"rtl": false,
"version": "2.6.4"
}
When I removed all node_modules folder and try reinstall it, I go to assets/semantic and do gulp build I have now this message : ```
gulp build [08:43:26] Local gulp not found in D:\PhpStormProjects\bookuto\assets\semantic [08:43:26] Try running: npm install gulp
Do I have to go to assets/semantic to gulp buil it ?
FUI releases up and including 2.6.4 don't support gulp 4.x yet. Support for gulp4 will be released with 2.7.0
I just tested building with your setup:
npm init npm i fomantic-ui cd assets/semantic/ npx gulp build
This worked for me
@etshy If the steps @ColinFrick provided don't work try removing your node_modules directory and your package-lock.json file and reinstalling your dependencies.
$ rm -rf node_modules package-lock.json
$ npm install
$ cd assets/semantic
$ npx gulp build
ah i didn't try to remove the lock yet.
I'll try that as soon as I can.
I don't have an error now, I just have this message : Cannot find module './tasks/config/user'.
Indeed the tasks folder is not here, do I need to add the tasks folder in my git ? I added only the src folder and gulp file.
I just copied the folder from the node_modules/fomantic-ui for this time.
It happened the same here trying to update from 2.6.4 to 2.7.1:
$ node -v
v8.11.3
$ npm -v
6.5.0
$ npx -v
6.5.0
$ gulp -v
CLI version 2.0.1
Local version 4.0.0
$ npx gulp build
/fomanticui/node_modules/gulp-help/index.js:81
task = gulp.tasks[name];
^
TypeError: Cannot read property 'help' of undefined
at Gulp.gulp.task (/fomanticui/node_modules/gulp-help/index.js:81:22)
at module.exports (/fomanticui/node_modules/gulp-help/index.js:97:8)
at Object.<anonymous> (/fomanticui/semantic/gulpfile.js:6:32)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
I've already deleted node_modules and package-lock.json, but the result is always the same.
@etshy @donaggio 2.7 introduced gulp4 which meant we needed to change the gulpfile.
We put these notes in the RELEASE-NOTES
UPGRADE NOTES: Gulp 4.0 introduced a new syntax to define tasks, that's why we had to introduce some changes to our gulpfile.js.
The new gulpfile.js can be found under tasks\config\npm\gulpfile.js. If you haven't changed the generated gulpfile.js in your fomantic destination folder you can just replace it with the new one. Otherwise you have to adopt the changes introduced in the file yourself.
For example if your fomantic destination directory is semantic:
semantic\tasks\config\npm\gulpfile.js => semantic\gulpfile.js
Sorry if you missed it, looking back it is quite hard to see.
@etshy Sorry it took so long to reply 😳
No problem, like I said I took the files from the node_modules folder and it worked after.
I'll try updating soon, I don't hink I have the 2.7.x yet and will comme back if I have the same kind of issue.
@hammy2899 semantic/tasks/config/npm/gulpfile.js and previous semantic/gulpfile.js have no differencies and it is the same as the version in github
Can we close this? Or are there still issues for somebody?
Reminder: Can we close this? Or are there still issues for somebody?
Assuming this is no longer an issue for anyone, closing.
npm install --save-dev gulp-help
please try this it worked for me