Unable to build my Vuejs application using npm run build - vue.js

When I run npm run build in my Vuejs application I get the following error:
compiler.hooks.compilation.tap(
^
TypeError: Cannot read property 'compilation' of undefined
at OptimizeCssAssetsWebpackPlugin.apply (C:\Users\EFOSA\Desktop\my_project\client\node_modules\last-call-webpack-plugin\src\index.js:170:20)
at Compiler.apply (C:\Users\EFOSA\Desktop\my_project\client\node_modules\tapable\lib\Tapable.js:375:16)
at webpack (C:\Users\EFOSA\Desktop\my_project\client\node_modules\webpack\lib\webpack.js:33:19)
at err (C:\Users\EFOSA\Desktop\my_project\client\build\build.js:19:3)
at next (C:\Users\EFOSA\Desktop\my_project\client\node_modules\rimraf\rimraf.js:75:7)
at CB (C:\Users\EFOSA\Desktop\my_project\client\node_modules\rimraf\rimraf.js:111:9)
at C:\Users\EFOSA\Desktop\my_project\client\node_modules\rimraf\rimraf.js:137:14
at FSReqWrap.oncomplete (fs.js:154:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my_project#1.0.0 build: node build/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my_project#1.0.0 build 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\EFOSA\AppData\Roaming\npm-cache_logs\2019-07-02T07_51_40_908Z-debug.log
I'm running webpack 3.12.
Could someone please help me with this?

There is a problem with your configuration and/or plugin version. Check the optimize-css-assets-webpack-plugin documentation:
For webpack v3 or below please use
optimize-css-assets-webpack-plugin#3.2.0. The
optimize-css-assets-webpack-plugin#4.0.0 version and above supports
webpack v4.

Related

While upgrading Angular from version 5.0 to 6.1, facing npm Error: Unknown argument: serve

Error: Unknown argument: serve
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-io-example#1.0.0 start: ng serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-io-example#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Please provide some solution for this, as I am stuck, not able to run my Angular application.
Encountered the same problem when setting up my development environment on different machine.
Use npm run serve instead. It worked to me.

fix errors according to npm install

I tried to npm install with vuejs and i stuck with this error
anyone help me
npm ERR! code E400
npm ERR! 400 Bad URI - GET http://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users..\AppData\Local\npm-cache_logs\2022-03-17T06_55_12_771Z-debug-0.log

Nuxt.js: fsevents is not a constructor

I'm using MacOS Mojave 10.14.5. When I run 'npm run dev' command where the nuxt starter package is located, I have 'fsevents' error, and the server doesn't work.
I already reinstall node and npm several times, but it doesn't work.
Here's an error:
/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:28
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:28:11)
at setFSEventsListener (/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:82:16)
at FSWatcher.FsEventsHandler._watchWithFsEvents (/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:252:16)
at FSWatcher.<anonymous> (/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:386:25)
at LOOP (fs.js:1570:14)
at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nuxt_test_b#1.0.0 dev: `nuxt`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nuxt_test_b#1.0.0 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! /Users/kimgyun/.npm/_logs/2019-06-06T02_11_18_374Z-debug.log
How can I run this nuxt.js server without this error?
It's a problem with fs events, and a rather annoying one at that. Specifically this happens when you're using Node 12.
You'll need to install fsevents#1.2.9 explicitly:
npm i fsevents#1.2.9 -D
or
yarn add fsevents#1.2.9 -D
This should work for you at this point.

Failed at the electron#1.8.2 postinstall script

I was trying to install electron into my project, but it is giving an error. I also tried to do this with unsafe-perm, but still giving the same error.
npm install electron --save-dev --save-exact
> electron#1.8.2 postinstall E:\PrgLang\Electron\crypto-app\node_modules\electron
> node install.js
Downloading electron-v1.8.2-win32-x64.zip
[============================================>] 100.0% of 55.21 MB (1.51 MB/s)
E:\PrgLang\Electron\crypto-app\node_modules\electron\install.js:47
throw err
^
Error: Could not parse checksum file at line 1:
at new ChecksumParseError (E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:71:127)
at E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:130:20
at Array.forEach (<anonymous>)
at E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:125:38
at new Promise (<anonymous>)
at ChecksumValidator.parseChecksumFile (E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:121:14)
at <anonymous>
npm WARN crypto-app#1.0.0 No description
npm WARN crypto-app#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#1.8.2 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#1.8.2 postinstall 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\Harshit\AppData\Roaming\npm-cache\_logs\2018-02-11T03_33_52_399Z-debug.log
Can you please try(after removing node_modules)
sudo npm install electron --save-dev --save-exact --unsafe-perm=true --allow-root
I was running into the same error and this is what worked for me.
According to this GitHub issue it could potentially be solved with one of the following actions:
remove the node_modules folder and run npm install again
rename the SHASUM file in your user home directory's .electron folder
The postinstall script of Electron is downloading a binary from a non-npm domain (possibly github.com), for which the proxy may not be configured.

Why npm start is not working and giving the following error messages:

I have one question regarding npm. Whenever I start npm, it gives the following error:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pomodorclock#1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pomodorclock#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
You first need to run npm install before you can build the package. After you can use npm start.