Error in Laravel npm package

Working on my Laravel project, I encountered an issue while trying to implement a video chat feature using https://github.com/PHPJunior/laravel-video-chat?ref=madewithlaravel.com with laravel-echo-server. Despite trying various solutions, none seemed to work. The error message that appeared when running the command npm run dev was:

> @ development c:\xampp\htdocs\lsapp
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress
--hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

c:\xampp\htdocs\lsapp\node_modules\webpack-cli\bin\cli.js:231
                                throw err;
                                ^

TypeError: Cannot read property 'js' of undefined
    at Object.<anonymous> (c:\xampp\htdocs\lsapp\webpack.mix.js:14:5)
    ...
   
   ...

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Dimitrije\AppData\Roaming\npm-cache\_logs\2019-02-20T10_31
_27_681Z-debug.log

npm ERR! code ELIFECYCLE
npm ERR! errno 1

...

In addition, here is my package.json file:

{
"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",
    ...
},
"devDependencies": {
    "axios": "^0.18",
    "bootstrap": "^4.0.0",
    ...
},
"dependencies": {
    "webpack": "^4.29.5"
}
}

Composer.json:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
...
}

After making a change in webpack.mix.js from const { mix } = require('laravel-mix'); to const mix = require('laravel-mix');, I encountered the following error:

...

To resolve this issue, additional dependencies must be installed. This requires running: npm install vue-template-compiler --save-dev --production=false

...

However, another error occurred:

...

Answer №1

Have you installed npm using the command npm install? Make sure to also check your error log file for any issues.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for resolving the "Unexpected reserved word" error during the installation of Laravel Jetstream

I have been following the steps outlined on to set up Laravel Jetstream. Upon running artisan jetstream:install, I selected Livewire support, API support, email verification, and PHPUnit support for installation. Next, I executed npm install as per the ...

The margin-top property in CSS is not functioning as intended for a specific pixel value when applied to

I'm having trouble with positioning an icon using margin-top: -35px; under #menu. When I click on the icon, the side navigation bar doesn't work properly. However, if I adjust it to -15px, the side navigation bar displays correctly. Can someone h ...

Insert a Facebook like button within a designated div

Can anyone figure out why the Facebook button isn't functioning properly? ---- ...

Vue's bidirectional data binding presents a challenge when attempting to update the parent component from a child component

I have the following components: Parent Component: <template> <v-container> <v-row class="text-center"> <v-col cols="12" class="parent"> <p>I am the Parent component</p> ...

Using jQuery/Javascript to create a dynamic content slider

I am currently working on developing a straightforward content slider. When the page loads, my goal is to display only one item (including an image and some content) and provide a navigation system for users to move through the items. Below is the basic H ...

Upon initializing mean.io assetmanager, a javascript error is encountered

I am eager to utilize the MEAN.io stack. I completed all the necessary initialization steps such as creating the folder, performing npm install, and obtaining the required libraries. Currently, in server/config/express.js file, I have the following code: ...

Issue with running Babel Transpiler and Nodemon together

Problem Description: Encountering issues using Babel Transpiler with Nodemon Specifics: Within my package.json file, the following scripts and dependencies are set up: "scripts": { "start": "nodemon --exec babel-node --presets=es2015 -- src/app.js" ...

Eliminate web address parameter using regular expressions

Looking to remove a specific URL parameter from a given URL. For instance, if the URL is: http://example.com?foo=bar&baz=boo And I want to eliminate foo=bar to get: http://example.com?baz=boo Or removing baz=boo would leave me with: http://exampl ...

Evaluating the conditional rendering of a React child component using Jest and Enzyme

I am currently working on expanding the test coverage for this particular file: import React, { useContext } from 'react'; import UserContext from '../../contexts/user'; import styles from './index-styles.scss'; const UserLog ...

"What is the best way to display a flash message upon successful completion of an AJAX request in Laravel

Is there a way to display a flash message after an ajax request redirects to a view? I'm having trouble getting the message to show up. Below is my code: Controller Code: \Session::flash('success', __('Password change successf ...

I am unable to install npm or node js within the git bash directory labeled phaser3-project-template

Every time I enter npm install in my Git Bash terminal, an error message pops up saying: > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d5a0b2b9bcb3acbfa6f8a2b0b7a5b4b6bef8a5b9a0b2bcbb95e5fbe1fbe3">[email protected ...

Tips for ensuring the server only responds after receiving a message from the client in a UDP Pinger system using sockets

I am in the process of developing a UDP pinger application. The objective is for the client to send a message (Ping) and receive pong back 10 times. However, the challenge lies in sending the messages one at a time instead of all together simultaneously. T ...

Using JavaScript to load the contents of a JSON file

I attempted to display data from a JSON file on an HTML page using jQuery / Javascript. However, each time I load the page, it remains blank. Below is the code snippet: index.html <!DOCTYPE html> <html> <head> <meta conten ...

Ways to simulate a class instance that is being received from a file with a different class instance

I am struggling with a specific file in my project // src/history import { createBrowserHistory } from 'history' const history = createBrowserHistory(); export default history; The variable history represents an instance of the BrowserHistory cl ...

No files found in dist/ directory when using Vue.js

Beginner's Note I must confess that I am a novice when it comes to web development. Please bear with me if this question seems silly; I appreciate your assistance in advance. Initial Setup My current node version is 16.15.1 and npm version is 9.5.0 ...

Guide on enabling users to input slide number and URL address to load content using Ajax

Is there a way to customize the number of slides in a slider and choose which content is loaded into each slide using AJAX calls in jQuery? Currently, my slider uses the jQuery .load() method to dynamically load content into each slide when it becomes vis ...

Learn how to retrieve the value on keyup in Laravel 5 when using Vue.js for editing purposes

Within our application, we have incorporated validation into the code. When working on the Edit section, how can I verify if a particular code already exists? The following snippet demonstrates my attempt: Edit Vue <label>Code</label> <inp ...

Unable to assign a scroll event delegation by using the "on" method

When attempting to delegate a scroll event in order for my element to maintain the same handler after being returned by an ajax call, I utilized the on method for delegation. $('body').on({ scroll:function(){ alert('scrolling&ap ...

Is the on.click event fired before the ajax request is made?

Having two events, the second one initiates an Ajax call. When a click creates an input in the <td>, it gets replaced by the success event afterwards - ensuring that the input is correct upon blur. $(document).on("click","#"+table_id+" td",function( ...

Filtering records in Sails.js through route parameters

As a newcomer to Sails.js, I'm delving into its capabilities and workings. My scenario involves three interconnected models through associations: Series.js -> Season.js -> and Episode.js. Series.js module.exports = { attributes: { /* ...