Laravel, elixir and gulp

I have gulpfile.js with content

var gulp = require('gulp');//this is working
gulp.task('default', function() { });//this is working
var elixir = require('laravel-elixir');//this is NOT working

Running "gulp" in cmd I get a message:

C:\myaccount\workspace\todoparrot>gulp
module.js:338
    throw err;
    ^
Error: Cannot find module 'lodash._baseclone'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\myaccount\workspace\todoparrot\node_modules\laravel-elixir\node_modules\gulp-notify\node_modules\node-notifier\node_modules\lodash.clonedeep\index.js:9:17)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

the gulp command works, but how to configure the elixir to work, that gulp works on it. What is the version of laravel / elixir to write to the composer.js file, it requires {.., "laravel / elixir": "???????", ..}. This is "laravel / elixir" or "laravel-elixir". I can not find enough good instructions.

+4
source share
3 answers

npm install - , laravel-elixir package.json, , , :

{
  "private": true,
  "devDependencies": {
  "gulp": "^3.8.8"
   },
"dependencies": {
"babelify": "^7.2.0",
"browser-sync": "^2.7.10",
"browserify": "^11.2.0",
"del": "^1.2.0",
"glob": "^5.0.14",
"gulp-autoprefixer": "^2.3.1",
"gulp-babel": "^6.1.0",
"babel-preset-es2015": "^6.1.0",
"babel-preset-react": "^6.1.18",
"gulp-batch": "^1.0.5",
"gulp-coffee": "^2.3.1",
"gulp-concat": "^2.6.0",
"gulp-if": "^1.2.5",
"gulp-less": "^3.0.3"
  }
}

BIT BY BIT https://github.com/laravel/elixir/blob/master/package.json

 "laravel-elixir": "^4.0.0" 

npm install,

+4

"npm install" .

+4

if you read the error message correctly, it means that in the laravels application to contact the file in node-module / path that he encountered, the best solution is to search for such a file and configure all links to its "name". I encountered the same issuse when trying to start larvel-elixir, the problem came out to be "laravel-elix /" was incorrectly indicated in my gulfile.js. Relax and try again

0
source

Source: https://habr.com/ru/post/1611069/


All Articles