2
votes

Im trying to install npm for first time. When I run npm install, then npm run dev, it say webpack-cli must install. After I install it, I got this error:

C:\Users\Lokman02Naza\Documents\laravel\pizzahouse> npm run dev

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

CLI for webpack must be installed. webpack-cli (https://github.com/webpack/webpack-cli)

We will use "npm" to install the CLI via "npm install -D". Do you want to install 'webpack-cli' (yes/no): yes Installing 'webpack-cli' (running 'npm install -D webpack-cli')...

added 34 packages, and audited 1161 packages in 6s

53 packages are looking for funding run npm fund for details

found 0 vulnerabilities [webpack-cli] Unknown argument: --hide-modules ? Which flags do you want to use? ... √ --entry: The entry point(s) of your application e.g. ./src/main.js √ Which flags do you want to use? · No items were selected [webpack-cli] Executing CLI

√ Which flags do you want to use? · No items were selected [webpack-cli] Executing CLI

[webpack-cli] Compilation finished asset main.js 644 bytes [emitted] (name: main)

ERROR in main Module not found: Error: Can't resolve './src' in 'C:\Users\Lokman02Naza\Documents\laravel\pizzahouse' webpack 5.3.2 compiled with 1 error in 57 ms [webpack-cli] Compilation finished asset main.js 644 bytes [emitted] (name: main)

ERROR in main Module not found: Error: Can't resolve './src' in 'C:\Users\Lokman02Naza\Documents\laravel\pizzahouse' webpack 5.3.2 compiled with 1 error in 57 ms npm ERR! code 1 npm ERR! path C:\Users\Lokman02Naza\Documents\laravel\pizzahouse npm ERR! command failed pack/bin/webpack.js --pr npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Lokman02Naza\AppData\Local\npm-cache_logs\2020-10-30T03_40_34_931Z-debug.log
npm ERR! code 1 npm ERR! path C:\Users\Lokman02Naza\Documents\laravel\pizzahouse npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "npm run development"

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Lokman02Naza\AppData\Local\npm-cache_logs\2020-10-30T03_40_34_948Z-debug.log

How to I solve it?

1
What do you use to exec those commands PowerShell ?Svetoslav
Yes. Do I need to use others git?Lokman
Module not found: Error: Can't resolve './src' in 'C:\Users\Lokman02Naza\Documents\laravel\pizzahouse' is there a src folder at the location that the ERROR triggers ?Svetoslav

1 Answers

0
votes

I clean forgot step 1. I simply ran the following in my cmd console which solved my issue.

composer global require "laravel/installer"