ember-cordova - Invalid or unexpected token on __dirname - node.js

I'm trying to build Android app using my Ember frontend and Cordova.
I've configured project as described in ember-cordova docs (changed rootURL and locationType),
I installed ember-cordova via ember install ember-cordova,
Changed app name and widget id in cordova/config.xml,
Added required platform - ember cdv:platform add android,
And I'm trying to build first version of my app using ember cdv:build --platform=android --environment=production.
Unfortunatelly, build fails with error:
EmberCordovaError: Invalid or unexpected token
Stack Trace and Error Report: /tmp/error.dump.0bfefb855ac286c6b6600c600e92d126.log
It happens both on Ubuntu 21.10 and macOS Monterey. I'm using node v12.22.7 installed via node version manager (tried using node from apt packages on Ubuntu, but it didn't help), ember-cordova v1.0.9, and ember v3.12.1.
Full error log:
=================================================================================
ENV Summary:
TIME: Fri Dec 03 2021 12:37:28 GMT+0100 (GMT+01:00)
TITLE: ember
ARGV:
- /home/tomasz/.nvm/versions/node/v12.22.7/bin/node
- /home/tomasz/.nvm/versions/node/v12.22.7/bin/ember
- cdv:build
- --platform=android
- --environment=production
EXEC_PATH: /home/tomasz/.nvm/versions/node/v12.22.7/bin/node
TMPDIR: /tmp
SHELL: /bin/bash
PATH:
- /home/tomasz/.rvm/gems/ruby-3.0.3/bin
- /home/tomasz/.rvm/gems/ruby-3.0.3#global/bin
- /home/tomasz/.rvm/rubies/ruby-3.0.3/bin
- /home/tomasz/.rvm/bin
- /home/tomasz/.local/bin
- /home/tomasz/bin
- /home/tomasz/.nvm/versions/node/v12.22.7/bin
- /home/tomasz/.local/bin
- /home/tomasz/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /snap/bin
- /home/tomasz/.rvm/bin
PLATFORM: linux x64
FREEMEM: 18971971584
TOTALMEM: 33553645568
UPTIME: 4862
LOADAVG: 6.15,4.98,3.74
CPUS:
- Intel(R) Core(TM) i5-4670 CPU # 3.40GHz - 3505
- Intel(R) Core(TM) i5-4670 CPU # 3.40GHz - 3565
- Intel(R) Core(TM) i5-4670 CPU # 3.40GHz - 3800
- Intel(R) Core(TM) i5-4670 CPU # 3.40GHz - 3800
ENDIANNESS: LE
VERSIONS:
- ares: 1.17.2
- brotli: 1.0.9
- cldr: 37.0
- http_parser: 2.9.4
- icu: 67.1
- llhttp: 2.1.4
- modules: 72
- napi: 8
- nghttp2: 1.41.0
- node: 12.22.7
- openssl: 1.1.1l
- tz: 2019c
- unicode: 13.0
- uv: 1.40.0
- v8: 7.8.279.23-node.56
- zlib: 1.2.11
ERROR Summary:
- broccoliBuilderErrorStack: [undefined]
- code: [undefined]
- codeFrame: [undefined]
- errorMessage: EmberCordovaError: Invalid or unexpected token
- errorType: [undefined]
- location:
- column: [undefined]
- file: [undefined]
- line: [undefined]
- message: EmberCordovaError: Invalid or unexpected token
- name: EmberCordovaError
- nodeAnnotation: [undefined]
- nodeName: [undefined]
- originalErrorMessage: [undefined]
- stack: (function (exports, require, module, __filename, __dirname) { #!/usr/bin/env node
^
SyntaxError: Invalid or unexpected token
at new Script (vm.js:88:7)
at createScript (vm.js:261:10)
at Object.runInThisContext (vm.js:309:10)
at wrapSafe (internal/modules/cjs/loader.js:902:15)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Api.getPlatformInfo (/home/tomasz/Projects/app-ember/ember-cordova/cordova/platforms/android/cordova/Api.js:174:22)
at /home/tomasz/Projects/app-ember/node_modules/cordova-lib/src/cordova/prepare.js:53:67
at Array.map (<anonymous>:null:null)
at /home/tomasz/Projects/app-ember/node_modules/cordova-lib/src/cordova/prepare.js:51:43
at _fulfilled (/home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:787:54)
at /home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:816:30
at Promise.promise.promiseDispatch (/home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:749:13)
at /home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:557:44
at flush (/home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:108:17)
at processTicksAndRejections (internal/process/task_queues.js:79:11)
=================================================================================
What could be a reason of such a failure?

Related

Error while deploying React App on Vercel

I tried deploying my React App on Vercel but i get those error messages:
The cli flag --force was set. Skipping build cache download.
Cloning completed: 687.734ms
Running "vercel build"
Vercel CLI 28.4.17
Installing dependencies...
yarn install v1.22.17
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads ssh://git#github.com/ethereumjs/ethereumjs-abi.git
Directory: /vercel/path0
Output:
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
yarn run v1.22.17
$ next build
info - Loaded env from /vercel/path0/.env
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
info - Linting and checking validity of types...
error - ESLint must be installed in order to run during builds: yarn add --dev eslint
info - Creating an optimized production build...
info - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
info - Using external babel configuration from /vercel/path0/.babelrc
Failed to compile.
../../usr/local/share/.config/yarn/global/node_modules/next/dist/pages/_document.js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.mod._resolveFilename (/usr/local/share/.config/yarn/global/node_modules/next/dist/build/webpack/require-hook.js:23:32)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
../../usr/local/share/.config/yarn/global/node_modules/next/dist/pages/_error.js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.mod._resolveFilename (/usr/local/share/.config/yarn/global/node_modules/next/dist/build/webpack/require-hook.js:23:32)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
./pages/_app.js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.mod._resolveFilename (/usr/local/share/.config/yarn/global/node_modules/next/dist/build/webpack/require-hook.js:23:32)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
./pages/index.js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
./pages/product/[slug].js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.mod._resolveFilename (/usr/local/share/.config/yarn/global/node_modules/next/dist/build/webpack/require-hook.js:23:32)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
> Build failed because of webpack errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1
I can't deploy on Vercel, any tip on how to fix that?
Thanks in advance.
I'll also leave a link to a video including the full Vercel log with errors highlighted in red: https://www.veed.io/view/218cb302-0a04-406f-84a9-7b5d353a2ffa?sharingWidget=true&panel=share
I tried building and launching the React App on Visual Studio with "yarn run dev" and "yarn run build" and everything works fine, proglems appear while trying to deploy it on Vercel.

Error: Electron failed to install correctly - shadow-cljs - failed to load module$node_modules$electron$index

this error occurs when running electron progam with clojruescript and shadow-cljs
node version 16
electron 17 or 19 - both fail
clojurescript 11.1.4
shadow-cljs 2.18.0
shadow-cljs - failed to load module$node_modules$electron$index
SHADOW import error /home/user/programs/Cara-Dune/.shadow-cljs/builds/main/dev/out/cljs-runtime/Cara_Dune.main.js
App threw an error during load
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at Object.shadow$provide.module$node_modules$electron$index (/home/user/programs/Cara-Dune/.shadow-cljs/builds/main/dev/out/cljs-runtime/node_modules/electron/index.js:19:15)
at Object.shadow.js.jsRequire (/home/user/programs/Cara-Dune/.shadow-cljs/builds/main/dev/out/cljs-runtime/shadow/js.js:66:18)
at Object.shadow.js.require (/home/user/programs/Cara-Dune/.shadow-cljs/builds/main/dev/out/cljs-runtime/shadow/js.js:113:20)
at /home/user/programs/Cara-Dune/.shadow-cljs/builds/main/dev/out/cljs-runtime/Cara_Dune.main.js:5:50
at global.SHADOW_IMPORT (/home/user/programs/Cara-Dune/out/jar/main.js:64:44)
at /home/user/programs/Cara-Dune/out/jar/main.js:1607:1
at Object.<anonymous> (/home/user/programs/Cara-Dune/out/jar/main.js:1610:3)
at Module._compile (node:internal/modules/cjs/loader:1116:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at Object.shadow$provide.module$node_modules$electron$index (/home/user/programs/Cara-Dune/.shadow-cljs/builds/main/dev/out/cljs-runtime/node_modules/electron/index.js:19:15)
at Object.shadow.js.jsRequire (/home/user/programs/Cara-Dune/.shadow-cljs/builds/main/dev/out/cljs-runtime/shadow/js.js:66:18)
at Object.shadow.js.require (/home/user/programs/Cara-Dune/.shadow-cljs/builds/main/dev/out/cljs-runtime/shadow/js.js:113:20)
at /home/user/programs/Cara-Dune/.shadow-cljs/builds/main/dev/out/cljs-runtime/Cara_Dune.main.js:5:50
at global.SHADOW_IMPORT (/home/user/programs/Cara-Dune/out/jar/main.js:64:44)
at /home/user/programs/Cara-Dune/out/jar/main.js:1607:1
at Object.<anonymous> (/home/user/programs/Cara-Dune/out/jar/main.js:1610:3)
at Module._compile (node:internal/modules/cjs/loader:1116:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
shadow-cljs - #8 ready!
[401568:0528/134352.966983:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
^C/home/user/programs/Cara-Dune/node_modules/electron/dist/electron exited with signal SIGINT
cannot start program with npx electron main.js - how to solve this issue?
resolved
; error when using shadow-cljs for require
(:require ["electron" :as electron])
; works
(defonce electron (js/require "electron"))

'npm install' gets stuck and eventually 'Killed' at something called 'swc...' on Ubuntu 20.04

Okay so I have been trying to deploy a Next app to my Ubuntu 20.04 vps but I am unable to do so. I have uploaded all the files from my local machine to the server via ftp and then after trying to install it gets stuck and then killed ( please check the image to see where it gets stuck ). The app works perfectly in my local machine.
I tried by deleting .next directory, node_modules directory as well as package-lock.json file but the problem prevails.
Here's the Node and NPM version in my local machine:
Node: v14.15.0
NPM: v7.14.0
This is the Node and NPM version in my server:
Node: v14.18.2
NPM: v8.3.0
I have also attached my package.json file incase you want to see the dependencies
UPDATE
I some how installed the dependencies but now I am getting different type of errors when I run 'npm run dev' or 'npm run build'.
Here's what I get after I run npm run dev:
[20:09] [server1.example.com boomboom] # npm run dev
> boomboom#0.1.0 dev
> next dev
warn - Port 3000 is in use, trying 3001 instead.
ready - started server on 0.0.0.0:3001, url: http://localhost:3001
info - Loaded env from /home/user1/node-apps/boomboom/.env.local
error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[4].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[4].use[2]!./styles/Footer.module.css
/home/user1/node-apps/boomboom/node_modules/source-map/lib/util.js:101
// above the root is a no-op. Therefore we can remove all '.
SyntaxError: Unexpected end of input
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: SyntaxError: /home/user1/node-apps/boomboom/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/package.json (directory description file): SyntaxError: Unexpected end of JSON input
<w> while resolving 'whatwg-url' in /home/user1/node-apps/boomboom/node_modules/mongodb-connection-string-url to a directory
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: SyntaxError: /home/user1/node-apps/boomboom/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/package.json (directory description file): SyntaxError: Unexpected end of JSON input
<w> while resolving 'whatwg-url' in /home/user1/node-apps/boomboom/node_modules/mongodb-connection-string-url to a directory
This is what I get after I run npm run build:
[20:13] [server1.example.com boomboom] # npm run build
> boomboom#0.1.0 build
> next build
info - Loaded env from /home/user1/node-apps/boomboom/.env.local
info - Checking validity of types
error - ESLint: Failed to load plugin 'react' declared in '.eslintrc.json » eslint-config-next/core-web-vitals » /home/user1/node-apps/boomboom/node_modules/eslint-config-next/index.js': Cannot find module 'eslint-plugin-react' Require stack: - /home/user1/node-apps/boomboom/node_modules/eslint-config-next/index.js Referenced from: /home/user1/node-apps/boomboom/node_modules/eslint-config-next/index.js
> Build error occurred
/home/user1/node-apps/boomboom/node_modules/source-map/lib/util.js:101
// above the root is a no-op. Therefore we can remove all '.
SyntaxError: Unexpected end of input
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/home/user1/node-apps/boomboom/node_modules/source-map/lib/source-map-generator.js:9:12)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
info - Creating an optimized production build .[20:13] [server1.example.com boomboom] #

jhipster error in windows

I was able to run the steps in the this link in Mac
When I tried the same example in Windows , I get the below error on npm start.
[at-loader] Ok, 0.216 sec.
Error: spawn UNKNOWN
at _errnoException (util.js:999:13)
at ChildProcess.spawn (internal/child_process.js:340:11)
at exports.spawn (child_process.js:499:9)
at Object.exports.execFile (child_process.js:209:15)
at Object.module.exports.fileCommand (D:\Users\myusername\Projects\apps\testjhispter\node_modules\node-notifier\lib\utils.js:53:13)
at WindowsToaster.notify (D:\Users\myusername\Projects\apps\testjhispter\node_modules\node-notifier\notifiers\toaster.js:65:9)
at module.exports.WebpackNotifierPlugin.compilationDone (D:\Users\myusername\Projects\apps\testjhispter\node_modules\webpack-notifier\index.js:62:18)
at Compiler.applyPlugins (D:\Users\myusername\Projects\apps\testjhispter\node_modules\tapable\lib\Tapable.js:61:14)
at Watching._done (D:\Users\myusername\Projects\apps\testjhispter\node_modules\webpack\lib\Compiler.js:105:17)
at onCompiled (D:\Users\myusername\Projects\apps\testjhispter\node_modules\webpack\lib\Compiler.js:55:18)
at applyPluginsAsync.err (D:\Users\myusername\Projects\apps\testjhispter\node_modules\webpack\lib\Compiler.js:510:14)
at next (D:\Users\myusername\Projects\apps\testjhispter\node_modules\tapable\lib\Tapable.js:202:11)
at D:\Users\myusername\Projects\apps\testjhispter\node_modules\awesome-typescript-loader\src\instance.ts:488:25
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
[Browsersync] Proxying: http://localhost:9060
[Browsersync] Access URLs:
-------------------------------------
Local: http://localhost:9000
External: http://10.23.150.12:9000
-------------------------------------
UI: http://localhost:3001
UI External: http://10.23.150.12:3001
-------------------------------------
webpack: wait until bundle finished: /
webpack: wait until bundle finished: /
webpack: wait until bundle finished: /
webpack: wait until bundle finished: /
webpack: wait until bundle finished: /
Windows 10 Enterprise
Node version 9.3.0
NPM version 5.6.0
JHipster version 4.13.0
Installed node LTS version and got the same error again
Error: spawn UNKNOWN
at _errnoException (util.js:1024:11)
at ChildProcess.spawn (internal/child_process.js:323:11)
at exports.spawn (child_process.js:502:9)
at Object.exports.execFile (child_process.js:212:15)
at Object.module.exports.fileCommand (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\node-notifier\lib\utils.js:53:13)
at WindowsToaster.notify (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\node-notifier\notifiers\toaster.js:65:9)
at module.exports.WebpackNotifierPlugin.compilationDone (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\webpack-notifier\index.js:62:18)
at Compiler.applyPlugins (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\tapable\lib\Tapable.js:61:14)
at Watching._done (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\webpack\lib\Compiler.js:105:17)
at compiler.emitRecords.err (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\webpack\lib\Compiler.js:79:19)
at Compiler.emitRecords (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\webpack\lib\Compiler.js:371:38)
at compiler.emitAssets.err (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\webpack\lib\Compiler.js:62:20)
at applyPluginsAsyncSeries1.err (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\webpack\lib\Compiler.js:364:12)
at next (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\tapable\lib\Tapable.js:218:11)
at Compiler.compiler.plugin (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
at next (D:\Users\myusername\Projects\apps\testjhipsterlts\node_modules\tapable\lib\Tapable.js:220:14)
Windows 10 Enterprise Edition
Node 8.9.3
npm 5.6.0
JHipster 4.13.0
Tried installing yarn and using it instead of npm - no luck. I still get the same error

Html Webpack Plugin: Child Compilation Failed error in React page

I'm new to React, and I'm following a tutorial, and after a 'yarn start' command, I go to 'localhost:3000' and see this error appear:
Error: Child compilation failed:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: [BABEL] C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\buildin\glob al.js: Cannot find module './src/data'
It's the first step of the tutorial that has anything to do with React at all, so I don't see where could I have gone wrong, any ideas on what the problem might be would be very useful.
The full error is this:
Error: Child compilation failed:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: [BABEL] C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\buildin\glob al.js: Cannot find module './src/data'
Require stack:
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\helpers.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\get-modules-list-f or-target-version.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_modul es\#babel\preset-env\lib\polyfills\corejs3\entry-plugin.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_modul es\#babel\preset-env\lib\index.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\dependenci es.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\plug ins.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\inde x.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\index.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-loader\lib\index.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\loadLoader.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\LoaderRunner.js - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModule.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModuleFactory.j s
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\Compiler.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\webpack.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\react-scripts\scripts\start.js (W hile processing: "C:\\Users\\Iván\\PycharmProjects\\django_react\\django-todo-react\\frontend\\node_modules\\babel-pre set-react-app\\dependencies.js$0$9")
- loader.js:797 Function.Module._resolveFilename
internal/modules/cjs/loader.js:797:15
- loader.js:690 Function.Module._load
internal/modules/cjs/loader.js:690:27
- loader.js:852 Module.require
internal/modules/cjs/loader.js:852:19
- helpers.js:74 require
internal/modules/cjs/helpers.js:74:18
- helpers.js:3 Object.
[frontend]/[core-js-compat]/helpers.js:3:14
- loader.js:959 Module._compile
internal/modules/cjs/loader.js:959:30
- loader.js:995 Object.Module._extensions..js
internal/modules/cjs/loader.js:995:10
- loader.js:815 Module.load
internal/modules/cjs/loader.js:815:32
- loader.js:727 Function.Module._load
internal/modules/cjs/loader.js:727:14
- loader.js:852 Module.require
internal/modules/cjs/loader.js:852:19
- helpers.js:74 require
internal/modules/cjs/helpers.js:74:18
- get-modules-list-for-target-version.js:2 Object.
[frontend]/[core-js-compat]/get-modules-list-for-target-version.js:2:51
- loader.js:959 Module._compile
internal/modules/cjs/loader.js:959:30
- loader.js:995 Object.Module._extensions..js
internal/modules/cjs/loader.js:995:10
- loader.js:815 Module.load
internal/modules/cjs/loader.js:815:32
- Error: [BABEL] C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\buildin\gl obal.js: Cannot find module './src/data'
- Require stack:
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\helpers.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\get-modules-list -for-target-version.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_mod ules\#babel\preset-env\lib\polyfills\corejs3\entry-plugin.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_mod ules\#babel\preset-env\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\dependen cies.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\pl ugins.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\in dex.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-loader\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\loadLoader.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\LoaderRunner. js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModule.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModuleFactory .js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\Compiler.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\webpack.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\react-scripts\scripts\start.js (While processing: "C:\\Users\\Iván\\PycharmProjects\\django_react\\django-todo-react\\frontend\\node_modules\\babel -preset-react-app\\dependencies.js$0$9")
- Module build failed (from ./node_modules/babel-loader/lib/index.js):
- Error: [BABEL] C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\buildin\mo dule.js: Cannot find module './src/data'
- Require stack:
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\helpers.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\get-modules-list -for-target-version.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_mod ules\#babel\preset-env\lib\polyfills\corejs3\entry-plugin.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_mod ules\#babel\preset-env\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\dependen cies.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\pl ugins.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\in dex.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-loader\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\loadLoader.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\LoaderRunner. js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModule.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModuleFactory .js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\Compiler.js
I see three errors in total, all saying "Cannot find module './src/data'", so I guess there's that missing? In my project directory, I don't see anything called 'data' in the 'src' folder. Why could that be, or what should I add to fix it?
I think there is a bug in the core-js-combat version 3.4.6. This nasty bug is already fixed in version 3.4.7. So you can run npm install core-js-compat#3.4.7 --save .
temporary fix until the core-js-compat makes its way through all the repos:
npm i -s core-js-compat#3.4.7
Apparently this is related to a bad build of core-js-compat, which is a deep dependency of babel. These two posts have more information:
Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module './src/data'
I am getting an error of Html Webpack Plugin in reactjs
This is working for me you can also try this
npm install core-js-compat#3.4.7 --save

Resources