0

I need to install keybase-bot on an existing system which is based on Laravel. I have installed keybase-bot and its dependencies but it still gives me error like this. I am not a node.js dev so its really frustrating. I searched online for child_process issue which is now default part of node 12 but still it is not working.

I am using laravel web-mix to compile my node modules.

enter image description here

enter image description here

Package.json

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.19.2",
        "bootstrap": "^4.5.0",
        "cross-env": "^5.2.1",
        "jquery": "^3.5.1",
        "laravel-mix": "^4.1.4",
        "lodash": "^4.17.19",
        "popper.js": "^1.16.1",
        "resolve-url-loader": "^2.3.1",
        "sass": "^1.26.10",
        "sass-loader": "^7.3.1",
        "vue": "^2.6.11",
        "vue-template-compiler": "^2.6.11"
    },
    "dependencies": {
        "isexe": "^2.0.0",
        "keybase-bot": "^3.6.1",
        "lodash.camelcase": "^4.3.0",
        "lodash.kebabcase": "^4.1.1",
        "lodash.snakecase": "^4.1.1",
        "mkdirp": "^1.0.4",
        "which": "^2.0.2"
    }
}

webpack.mix.js

const mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .options({
        processCssUrls: false
    });

webpack.config.js

/**
 * As our first step, we'll pull in the user's webpack.mix.js
 * file. Based on what the user requests in that file,
 * a generic config object will be constructed for us.
 */
let mix = require('../src/index');

let ComponentFactory = require('../src/components/ComponentFactory');

new ComponentFactory().installAll();

require(Mix.paths.mix());

/**
 * Just in case the user needs to hook into this point
 * in the build process, we'll make an announcement.
 */

Mix.dispatch('init', Mix);

/**
 * Now that we know which build tasks are required by the
 * user, we can dynamically create a configuration object
 * for Webpack. And that's all there is to it. Simple!
 */

let WebpackConfig = require('../src/builder/WebpackConfig');

module.exports = new WebpackConfig().build();
Syed
  • 508
  • 3
  • 16
  • 1
    Do you have a custom webpack config? Try setting `node` to `true`. https://webpack.js.org/configuration/node/ The missing module "fs" is standard node without any dependencies. So I guess that either there is some installation problem with node (reinstall?) or some configuration problem. `mix.webpackConfig({ node: true, ...snip });` – ippi Jul 20 '20 at 09:27
  • Install fs `npm i fs` – maki10 Jul 20 '20 at 10:29
  • I have updated my question @ippi please have a look – Syed Jul 20 '20 at 11:04
  • Possible duplicate: https://stackoverflow.com/questions/40950176/module-not-found-error-cant-resolve-fs – Hedegare Jul 20 '20 at 11:06
  • @Jackowski How can it be possible duplicate? when I have multiple errors? – Syed Jul 20 '20 at 11:19
  • I added this mix.webpackConfig({ node: { fs: 'empty' }}) to the webpack.mix.js and it got rid of fs error but the 'client_process' and 'readline' are still their. @ippi – Syed Jul 20 '20 at 11:21
  • @Jackowski Please read the question. the issue I raised was regarding 'child_process' – Syed Jul 20 '20 at 11:29

0 Answers0