Slack Integraton with Laravel Issues

69 views Asked by At

I am trying to install slack node library, but not able to do it successfully. I installed this library successfully on laravel 5.4 using node js. And my gulpfile is upgraded from 5.3 to 5.4 and attached below.

npm install @slack/client --save (Installation is fine but gukp is causing issue)

But when i run gulp command on shell i am getting following error:-

After adding adding this line in app.js:-

var RtmClient = require('@slack/client').RtmClient;

gulpfile.js (manually eddited)

const elixir = require('laravel-elixir');
const path = require('path');
const debug = require('gulp-debug');
const moment = require('moment');// in my gulp file
require('laravel-elixir-webpack-official');
require('laravel-elixir-vue-2');

elixir(function(mix) {
    // Elixir.webpack.config.module.loaders = [];
    Elixir.webpack.mergeConfig({
        resolveLoader: {
            root: path.join(__dirname, 'node_modules'),
        },
        module: {
            loaders: [
                {
                    test: /\.css$/,
                    loader: 'style!css'
                }
            ]
        }
    });
    mix.sass('app.scss')
    .webpack('app.js')
    .copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap')
});

Error on Gulp Command

user1@console:/opt/lampp/htdocs/dev$ gulp
[15:40:27] Using gulpfile /opt/lampp/htdocs/dev/gulpfile.js
[15:40:27] Starting 'all'...
[15:40:27] Starting 'sass'...
[15:40:28] Finished 'sass' after 1.08 s
[15:40:28] Starting 'webpack'...
{ [Error: ./~/winston/package.json
Module parse failed: /opt/lampp/htdocs/dev/node_modules/winston/package.json Unexpected token (2:9)
You may need an appropriate loader to handle this file type.
| {
|   "_args": [
|     [
|       {
 @ ./~/winston/lib/winston.js 14:18-44
 @ ./~/@slack/client/lib/helpers.js
 @ ./~/@slack/client/lib/clients/client.js
 @ ./~/@slack/client/lib/clients/web/client.js
 @ ./~/@slack/client/index.js
 @ ./resources/assets/js/app.js./~/winston/lib/winston/common.js
Module not found: Error: Can't resolve 'fs' in '/opt/lampp/htdocs/dev/node_modules/winston/lib/winston'
resolve 'fs' in '/opt/lampp/htdocs/dev/node_modules/winston/lib/winston'
  Parsed request is a module
  using description file: /opt/lampp/htdocs/dev/node_modules/winston/package.json (relative path: ./lib/winston)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /opt/lampp/htdocs/dev/node_modules/winston/package.json (relative path: ./lib/winston)
    resolve as module
      /opt/lampp/htdocs/dev/node_modules/node_modules doesn't exist or is not a directory

Thanks in advance

0

There are 0 answers