Cant run webpack server or laravel server Amazon C9


Hey all,

I just have a few inquiries to make as I’m having a little bit of difficulty running a server through cloud 9, I have read a few other issues regarding this topic but none of the solutions appears to be working. Right now I’m running laravel 5.6, I want to take advantage of things like hot reloading and all of the package.json scripts. I can run the scripts perfectly fine however, the trouble comes when I try to view the application in the browser. I keep getting ‘Invalid Host header’.

I put these arguments on inside of the npm hot script ‘–host $IP --port $PORT’ but I got no URL. I then tried to put these arguments on the dev script however I get a nasty error stating the following:

                            var i = content.indexOf("=");

 TypeError: content.indexOf is not a function
  at /home/ec2-user/environment/cms/node_modules/webpack/bin/convert-argv.js:535:21
  at Array.forEach (native)
  at processOptions (/home/ec2-user/environment/cms/node_modules/webpack/bin/convert-argv.js:534:11)
  at processConfiguredOptions (/home/ec2-user/environment/cms/node_modules/webpack/bin/convert-
 at module.exports (/home/ec2-user/environment/cms/node_modules/webpack/bin/convert-argv.js:112:10)
 at yargs.parse (/home/ec2-user/environment/cms/node_modules/webpack/bin/webpack.js:171:41)
 at Object.Yargs.self.parse (/home/ec2-user/environment/cms/node_modules/yargs/yargs.js:533:18)
 at Object.<anonymous> (/home/ec2-user/environment/cms/node_modules/webpack/bin/webpack.js:152:7)
 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)
 at Module.runMain (module.js:604:10)
 at run (bootstrap_node.js:383:7)
 at startup (bootstrap_node.js:149:9)

 npm ERR! Linux 4.9.77-31.58.amzn1.x86_64


    "private": true,
    "scripts": {
        "dev": "npm run development  --host $IP --port $PORT",
        "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": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --host $IP --port $PORT --config=node_modules/laravel-mix/setup/webpack.config.js --progress --hot",
        "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.17",
        "bootstrap": "^4.0.0",
        "popper.js": "^1.12",
        "cross-env": "^5.1",
        "jquery": "^3.2",
        "laravel-mix": "^2.0",
        "lodash": "^4.17.4",
        "vue": "^2.5.7"

Any Help would be greatly appreciated.

1 Like


Have you found solution?