JeffreyWay / laravel-elixir-webpack-official

88 stars 28 forks source link

Error in installation with npm. Not installed. #31

Open xeodev-zz opened 8 years ago

xeodev-zz commented 8 years ago

I'm working with laravel latest version 5.3. I try to work with vuejs 2, but have a problem in installing packages using npm. Here my package.json:

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch"
  },
  "devDependencies": {
    "bootstrap-sass": "^3.3.7",
    "gulp": "^3.9.1",
    "jquery": "^3.1.0",
    "laravel-elixir": "^6.0.0-9",
    "laravel-elixir-vue-2": "^0.2.0",
    "laravel-elixir-webpack-official": "^1.0.2",
    "lodash": "^4.16.2",
    "vue": "^2.0.1",
    "vue-resource": "^1.0.3"
  }
}

with > npm install installs all the packages but not install laravel-elixir-webpack-official.

So try to run 'gulp'.

and I get this:

C:\xampp\htdocs\appvue2\node_modules\laravel-elixir-vue-2\index.js:4
  Elixir.webpack.mergeConfig({
                ^

TypeError: Cannot read property 'mergeConfig' of undefined
    at C:\xampp\htdocs\appvue2\node_modules\laravel-elixir-vue-2\index.js:4:17
    at C:\xampp\htdocs\appvue2\node_modules\laravel-elixir\dist\index.js:29:16
    at Array.forEach (native)
    at global.Elixir (C:\xampp\htdocs\appvue2\node_modules\laravel-elixir\dist\index.js:28:24)
    at Object.<anonymous> (C:\xampp\htdocs\appvue2\gulpfile.js:16:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

The values are the default values that come in laravel 5.3. Why not install laravel-elixir-webpack-official ?.

Excuse me, I'm bad with English.

srph commented 8 years ago

Can you remove the node_modules directory, and reinstall the modules?

rm -rf node_modules && npm i
thijsbouwes commented 8 years ago

You have to install 'laravel-elixir-webpack-official', i tried to install it with npm install (Cygwin). It failled and in my case Cygwin (related: https://github.com/npm/npm/issues/7456) was the problem. Did a npm install on git bash and everything works oké now.

p.s. make sure you got the latest version of npm/node.