Laravel, elixir and gulp
Asked Answered
V

3

6

I've 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)

command gulp is working, but how to set the elixir to work, that gulp is working on it. What is laravel/elixir proper version for writing to file composer.js require {..,"laravel/elixir":"???????",..}. Is it "laravel/elixir" or "laravel-elixir". I'm unable to find sufficient good instructions.

Vernal answered 10/10, 2015 at 8:40 Comment(0)
A
5

Sometimes npm install fails to install packages due to your machine ram spec or services runing in server , try installing bit by bit the laravel-elixir package dependency in your package.json file then finish by adding the elixir package at the bottom of the file as in below :

{
  "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"
  }
}

ADD ALL DEPENDENCIES BIT BY BIT AS IN THIS FILE https://github.com/laravel/elixir/blob/master/package.json ONCE ALL DEPENCIES HAVE INSTALLED ADD

 "laravel-elixir": "^4.0.0" 

AT THE BOTTOM AND RUN npm install , this should install elixir and all dependencies

Allayne answered 1/12, 2015 at 21:47 Comment(0)
T
4

Try running "npm install" first to install dependencies.

Trivium answered 10/10, 2015 at 8:51 Comment(7)
I've tried several times npm install and other tricks. Can you give a proper sequence from installing to running.Vernal
Here's a copy of the package.json file I've got from a fresh install of Laravel 5.1, I basically just followed the steps in the documentation and had zero issues - pastie.org/10471807Trivium
Try removing npm completely and installing it locally instead of globally within your project, then going through the same process. It seems some people have had issues with this on Windows specifically. github.com/laravel/elixir/issues/266Trivium
Unfortunately I'm unable to get help from this deficient information and i need perfectly written tutorial for elixir using. Thank you for this help and i decided not to use the commonly nonworking elixir anymore. I make own script somewhere controller.Vernal
None of that makes any sense but sure, off you go then.Trivium
npm install reports some dependency errors in my case on Win 7. NodeJs is just installed on clean machine.Polard
Check do you have errors npm-gly when npm install. Possible cause node is in version v.xxx -pre or missing python, or try to run from git bash as admin.Polard
S
0

if you read the error message properly it implies that in laravels bid to contact a file in the node-module/ path it encountered an error best solution is to locate such a file and make adjustment to all references made to its "name". I encountered the same issuse when try to run larvel-elixir, problem came out to be "laravel-elix/" was referenced wrongly in my gulfile.js. Relax and try again

Science answered 18/12, 2016 at 11:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.