npm run dev issue (npm ERR! code ELIFECYCLE)

Error:-

> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

[webpack-cli] Error: Unknown option '--hide-modules'
[webpack-cli] Run 'webpack --help' to see available commands and options
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `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! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Cotocus5\AppData\Roaming\npm-cache\_logs21-08-12T12_23_56_189Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Cotocus5\AppData\Roaming\npm-cache\_logs21-08-12T12_23_56_273Z-debug.log

Solution:-

Step 1:- Run this command to verify cache

npm cache verify

Step 2:- Recheck your package.json and webpack.mix.js file it is correct or not.

Step 3:- Then Delete the Node Module file which is present in your project folder.

Step 4:- Run the Npm install command.

npm install

Step 5:- Then Run npm run dev command.

npm run dev
Tagged : / / / /

error in ./resources/assets/sass/app.scss

If you are getting this error (error in ./resources/assets/sass/app.scss) in Node module please follow some steps which is have mentioned in the following

Error:-

Many of you get this error when you did not change anything in app.scss, but when I run npm run watch I get the following errors:

 error  in ./resources/sass/app.scss                                                                      

Module build failed (from ./node_modules/sass-loader/lib/loader.js):                                      
Unsupported operation: Cannot extract a file path from a URI with a fragment component                    

@ ./resources/sass/app.scss 2:14-254                                                                     

    Asset      Size   Chunks             Chunk Names                                                     
/js/app.js  2.46 MiB  /js/app  [emitted]  /js/app                                                         

ERROR in ./resources/sass/app.scss                                                                        
Module build failed (from ./node_modules/css-loader/index.js):                                            
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):                    

undefined                                                                                                 
      ^                                                                                                  
      Join(null, "variables"): part 0 was null, but part 1 was not.                                       
@import 'variables';                                                                                      
        ^^^^^^^^^^^                                                                                       
  stdin 2:9  root stylesheet                                                                              
      in C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\resources\sass\app.scss (line 2, column 9)           
    at runLoaders (C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\webpack\lib\NormalModule.js:30
    at C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\loader-runner\lib\LoaderRunner.js:364:11  
    at C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\loader-runner\lib\LoaderRunner.js:230:18  
    at context.callback (C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\loader-runner\lib\Loader
13)

Solution:-

The main issue which we have found that is related to dart-sass being used instead of node-sass with laravel

You have to just follow one step:-

Step 1:- You have to run this Command and all the things will solve .

npm install node-sass

Tagged : / / / / / / / / / /

‘cross-env’ is not recognized as an internal or external command, operable program or batch file.

Hey if you are getting some error like (‘cross-env’ is not recognized as an internal or external command, operable program or batch file.) in your Node please follow the steps which i have mentioned in following:-

You need to make cross-env working globally instead of having it in the project.

Step 1:- remove node_modules folder

Step 2:-  run this Command so that you cross-env work globally.

npm install --global cross-env

Step 3:- Remove “cross-env”: “5.0.1” from the devDependencies section of the package.json file. You may actually skip this step and keep package.json. If you’d want.

Step 4:- Then run this command.

npm install --no-bin-links

Step 5:- After this finally you can run your main command

npm run dev

Tagged : / / / / / / /

How to solve throwing npm error “npm ERR! code ELIFECYCLE” “npm ERR! errno 2” “npm ERR! @ dev: `npm run development`”

When you using “laravel 5.5” and whenever run command “npm install” then sometime it comes this type error.

Then run below commands –

Step 1-

npm install –save-dev cross-env

After that Your problem will be solve.

Tagged : / / /

Error with npm update: pngquant binary does not seem to work correctly

While installing npm for my ongoing project I got a error as shown below:

To rectify the error I followed the steps given below and it worked for me:

Step 1: Run sudo apt-get install libpng-dev.

Step 2: Run npm install -g pngquant-bin.

Step 3: Run npm install.

References:

Click here

Click here

Tagged : /