Pipeline keeps giving Error: spawn ps ENOENT - node.js

I'm new to git CI and I'm trying to create a pipeline for a school project. I need to run some tests with Cypress through the CI but I get an Error: spawn ps ENOENT.
The CI job:
cypress-test-job:
image: cypress/browsers:node16.14.0-slim-chrome99-ff97
stage: test
script:
- cd frontend-webpack/
- echo "Testing frontend with Cypress"
- npm ci
- npm run test
- echo "Testing complete"
My package.json:
{
"name": "seminar-week5-client",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"build": "npx webpack-cli",
"build:dev": "npx webpack-cli --mode=development",
"start": "npx webpack serve",
"watch": "npx webpack serve",
"lint": "npx eslint src/**.js src/js/**.js",
"cy:test": "npx cypress run",
"test:headless": "npx cypress run --spec cypress/integration/ToDo_tests.js",
"test": "start-server-and-test start http-get://localhost:8080 cy:test"
},
"author": "",
"license": "ISC",
"dependencies": {
"jquery": "^3.3.1",
"lodash": "^4.17.11",
"sass": "^1.49.11",
"wait-on": "^6.0.1"
},
"devDependencies": {
"babel-loader": "^8.2.4",
"css-loader": "^6.7.1",
"cypress": "^9.5.3",
"eslint": "^8.12.0",
"eslint-webpack-plugin": "^3.1.1",
"html-loader": "^3.1.0",
"html-webpack-plugin": "^5.5.0",
"sass-loader": "^12.6.0",
"start-server-and-test": "^1.14.0",
"style-loader": "^3.3.1",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.0"
}
}
The failed output of the pipeline:
Running with gitlab-runner 14.9.0~beta.68.g1283960c (1283960c)
on green-4.shared.runners-manager.gitlab.com/default ntHFEtyX
Resolving secrets
00:00
Preparing the "docker+machine" executor
00:41
Using Docker executor with image cypress/browsers:node16.14.0-slim-chrome99-ff97 ...
Pulling docker image cypress/browsers:node16.14.0-slim-chrome99-ff97 ...
Using docker image sha256:beaac0b58885bf17f2b91ce142daaed6658aaee184bff7c8f114e2210db567cc for cypress/browsers:node16.14.0-slim-chrome99-ff97 with digest cypress/browsers#sha256:e55e133a7b66e1e0fd13b8e7db1f545771ed3a98f76fc662fce268d02ab0aff9 ...
Preparing environment
00:02
Running on runner-nthfetyx-project-34382765-concurrent-0 via runner-nthfetyx-shared-1649414442-4ad4be93...
Getting source from Git repository
00:12
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/saxion.nl/hbo-ict/development-tools/web/38/.git/
Created fresh repository.
Checking out 8c002ea2 as master...
Skipping Git submodules setup
Executing "step_script" stage of the job script
02:45
Using docker image sha256:beaac0b58885bf17f2b91ce142daaed6658aaee184bff7c8f114e2210db567cc for cypress/browsers:node16.14.0-slim-chrome99-ff97 with digest cypress/browsers#sha256:e55e133a7b66e1e0fd13b8e7db1f545771ed3a98f76fc662fce268d02ab0aff9 ...
$ cd frontend-webpack/
$ echo "Testing frontend with Cypress"
Testing frontend with Cypress
$ npm ci
added 624 packages, and audited 625 packages in 55s
78 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npm run test
> seminar-week5-client#1.0.0 test
> start-server-and-test start http-get://localhost:8080 cy:test
1: starting server using command "npm run start"
and when url "[ 'http-get://localhost:8080' ]" is responding with HTTP status code 200
running tests using command "npm run cy:test"
> seminar-week5-client#1.0.0 start
> npx webpack serve
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/
<i> [webpack-dev-server] Content not from webpack is served from '/builds/saxion.nl/hbo-ict/development-tools/web/38/frontend-webpack/src' directory
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
[BABEL] Note: The code generator has deoptimised the styling of /builds/saxion.nl/hbo-ict/development-tools/web/38/frontend-webpack/node_modules/lodash/lodash.js as it exceeds the max of 500KB.
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
asset app.bundle.js 2.19 MiB [emitted] [minimized] [big] (name: main) 1 related asset
asset a5441281b140aaf5cb21.png 80.6 KiB [emitted] [immutable] [from: src/images/delete.png] (auxiliary name: main)
asset index.html 419 bytes [emitted]
runtime modules 27.5 KiB 13 modules
orphan modules 19.9 KiB [orphan] 9 modules
javascript modules 987 KiB
modules by path ./node_modules/ 980 KiB
modules by path ./node_modules/style-loader/dist/runtime/*.js 5.75 KiB 6 modules
modules by path ./node_modules/webpack-dev-server/client/ 56.8 KiB 4 modules
modules by path ./node_modules/webpack/hot/*.js 4.4 KiB 4 modules
modules by path ./node_modules/html-entities/lib/*.js 115 KiB 4 modules
modules by path ./node_modules/css-loader/dist/runtime/*.js 3.52 KiB 3 modules
+ 4 modules
modules by path ./src/ 6.81 KiB
./src/app.js + 1 modules 2.64 KiB [built] [code generated]
./src/styles/appStyle.scss 2.41 KiB [built] [code generated]
./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/appStyle.scss 1.76 KiB [built] [code generated]
./src/images/delete.png 42 bytes (javascript) 80.6 KiB (asset) [built] [code generated]
webpack 5.72.0 compiled successfully in 19130 ms
> seminar-week5-client#1.0.0 cy:test
> npx cypress run
[STARTED] Task without title.
[SUCCESS] Task without title.
[310:0408/104418.838935:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[310:0408/104418.839032:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[310:0408/104418.846171:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[475:0408/104418.911107:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is
tput: unknown terminal "xterm npm_config_loglevel warn npm_config_unsafe_perm true"
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 9.5.3 │
│ Browser: Electron 94 (headless) │
│ Node Version: v16.14.0 (/usr/local/bin/node) │
│ Specs: 1 found (ToDo_tests.js) │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: ToDo_tests.js (1 of 1)
[310:0408/104421.132271:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
My ToDo list
✓ can add new todo items (10167ms)
✓ can remove todo items (7887ms)
✓ Try adding duplicate item (3738ms)
✓ Delete the rest (2554ms)
4 passing (25s)
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 4 │
│ Passing: 4 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true │
│ Duration: 24 seconds │
│ Spec Ran: ToDo_tests.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Video)
- Started processing: Compressing to 32 CRF
Compression progress: 68%
- Finished processing: /builds/saxion.nl/hbo-ict/development-tools/web/38/frontend (20 seconds)
-webpack/cypress/videos/ToDo_tests.js.mp4
Compression progress: 100%
tput: unknown terminal "xterm npm_config_loglevel warn npm_config_unsafe_perm true"
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ ToDo_tests.js 00:24 4 4 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! 00:24 4 4 - - -
node:events:498
throw er; // Unhandled 'error' event
^
Error: spawn ps ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn ps',
path: 'ps',
spawnargs: [ '-A', '-o', 'ppid,pid,stat,comm' ]
}
Uploading artifacts for failed job
00:02
Uploading artifacts...
frontend-webpack/cypress/videos/*.mp4: found 1 matching files and directories
Uploading artifacts as "archive" to coordinator... 201 Created id=2310380359 responseStatus=201 Created token=gaMq6mXk
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1

Related

the vue-awesome-swiper dependency was not found

I tried to use swiper plugin on my nuxtjs project. But I've got error on my command line when I running "yarn run dev":
`
yarn run dev
yarn run v1.22.19
$ nuxt
WARN sass-loader#13.1.0 is installed but ^10.1.1 is expected
╭───────────────────────────────────────╮
│ │
│ Nuxt # v2.15.8 │
│ │
│ ▸ Environment: development │
│ ▸ Rendering: server-side │
│ ▸ Target: server │
│ │
│ Listening: http://localhost:3000/ │
│ │
╰───────────────────────────────────────╯
i Preparing project for development
i Initial build may take a while
√ Builder initialized
√ Nuxt files generated
* Client █████████████████████████ building (39%) 245/251 modul
es 6 active
node_modules\setimmediate\setImmediate.js
× Server
Compiled with some errors in 9.04s
× Client
Compiled with some errors in 10.53s
× Server
Compiled with some errors in 9.04s
ERROR Failed to compile with 1 errors
This dependency was not found:
* vue-awesome-swiper/dist/ssr in ./plugins/swiper.js
To install it, you can run: npm install --save vue-awesome-swiper/dist/ssr
i Waiting for file changes
i Memory usage: 143 MB (RSS: 232 MB)
i Listening on: http://localhost:3000/
WARN Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'
`
vue-awesome-swiper does not detected while I've installed by "yarn add vue-awesome-swiper".
And I've followed this instruction on cmd:
npm install --save vue-awesome-swiper/dist/ssr
i Waiting for file changes
i Memory usage: 143 MB (RSS: 232 MB)
i Listening on: http://localhost:3000/
But still have issued on my code. Does anyone have same problems and had solution?

Module not found: Error: Cannot resolve 'file' or 'directory' ../../

i am new for nodejs, in my hybris project, first i installed nodejs, run 'npm install','npm i cross-env' commands, when i run the command 'npm run hybris' from node_module folder, i got some errors can you provide any solution.
C:\Atlas_Insta\hybris\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop>npm run hybris
> RodanAndFields#1.0.0 hybris C:\Atlas_Insta\hybris\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop
> cross-env NODE_ENV=production gulp hybris-build
[15:29:07] Using gulpfile C:\Atlas_Insta\hybris\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop\gulpfile.js
[15:29:07] Starting 'clean'...
[15:29:07] Finished 'clean' after 128 ms
[15:29:07] Starting 'markupCompile'...
[15:29:08] Starting 'sass'...
[15:29:09] Finished 'sass' after 615 ms
[15:29:09] Starting 'js'...
[15:29:09] Finished 'js' after 129 ms
[15:29:09] Starting 'copy-img'...
[15:29:09] Finished 'copy-img' after 584 μs
[15:29:09] Starting 'copy-fonts'...
[15:29:09] Finished 'copy-fonts' after 597 μs
[15:29:09] Starting 'copy-api'...
[15:29:09] Finished 'copy-api' after 630 μs
[15:29:09] Starting 'read-templates'...
[15:29:09] Finished 'read-templates' after 1.87 ms
All templates written successfully!
[15:29:32] Version: webpack 1.15.0
Asset Size Chunks Chunk Names
app.js 1.19 MB 0 [emitted] app
app.map 9.63 MB 0 [emitted] app
ERROR in C:/Atlas_Repo/bin/custom/rodanandfields/rodanandfieldsstorefront/FE-Develop/web/webroot/WEB-INF/r2/fe-components/checkout/order-summary/order-summary.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../../../../../_ui/frontend/js/analytics/analytics-eventmap-r2 in C:\Atlas_Repo\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop\web/webroot/WEB-INF/r2/fe-components\checkout\order-summary
# C:/Atlas_Repo/bin/custom/rodanandfields/rodanandfieldsstorefront/FE-Develop/web/webroot/WEB-INF/r2/fe-components/checkout/order-summary/order-summary.js 23:30-103
ERROR in C:/Atlas_Repo/bin/custom/rodanandfields/rodanandfieldsstorefront/FE-Develop/web/webroot/WEB-INF/r2/fe-components/checkout/checkout-form-billing/checkout-form-billing.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../../../../../_ui/frontend/js/analytics/analytics-config-r2 in C:\Atlas_Repo\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop\web/webroot/WEB-INF/r2/fe-components\checkout\checkout-form-billing
# C:/Atlas_Repo/bin/custom/rodanandfields/rodanandfieldsstorefront/FE-Develop/web/webroot/WEB-INF/r2/fe-components/checkout/checkout-form-billing/checkout-form-billing.js 23:22-93
Which Hybris version are you using? I had a smilar problem with hybris 6.6. It worked for me after I switch to node v6.14.3 I was using a more recent node with a more recent npm version.
I found this version inside the npmancillary extension's folder
ext-content/npmancillary/resources/npm/node

nodejs Heroku build is timing out (it used to work)

I am trying to deploy a nodejs app I have via
git push heroku master
The build is failing due to timeout and here is the build log
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 10.x...
Downloading and installing node 10.15.3...
Using default npm version: 6.4.1
-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build
-----> Installing dependencies
Installing node modules (package.json + package-lock)
> node-expat#2.3.17 install /tmp/build_c3cb8f26de145fdc95dbb7c74ca4abea/node_modules/node-expat
> node-gyp rebuild
make: Entering directory '/tmp/build_c3cb8f26de145fdc95dbb7c74ca4abea/node_modules/node-expat/build'
CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlparse.o
../deps/libexpat/lib/xmlparse.c: In function ‘gather_time_entropy’:
../deps/libexpat/lib/xmlparse.c:780:7: warning: variable ‘gettimeofday_res’ set but not used [-Wunused-but-set-variable]
int gettimeofday_res;
^
CC(target) Release/obj.target/expat/deps/libexpat/lib/xmltok.o
CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlrole.o
AR(target) Release/obj.target/deps/libexpat/libexpat.a
COPY Release/libexpat.a
CXX(target) Release/obj.target/node_expat/node-expat.o
../node-expat.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Parser::Parse(Nan::NAN_METHOD_ARGS_TYPE)’:
../node-expat.cc:103:47: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
Local<Object> obj = info[0]->ToObject();
^
In file included from /app/.node-gyp/10.15.3/include/node/node.h:63:0,
from ../node_modules/nan/nan.h:52,
from ../node-expat.cc:1:
/app/.node-gyp/10.15.3/include/node/v8.h:10046:15: note: declared here
Local<Object> Value::ToObject() const {
^
../node-expat.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Parser::SetUnknownEncoding(Nan::NAN_METHOD_ARGS_TYPE)’:
../node-expat.cc:470:59: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
parser->xmlEncodingInfo->map[i] = m->Int32Value();
^
In file included from /app/.node-gyp/10.15.3/include/node/v8.h:26:0,
from /app/.node-gyp/10.15.3/include/node/node.h:63,
from ../node_modules/nan/nan.h:52,
from ../node-expat.cc:1:
/app/.node-gyp/10.15.3/include/node/v8.h:2478:46: note: declared here
V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
^
/app/.node-gyp/10.15.3/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^
SOLINK_MODULE(target) Release/obj.target/node_expat.node
COPY Release/node_expat.node
make: Leaving directory '/tmp/build_c3cb8f26de145fdc95dbb7c74ca4abea/node_modules/node-expat/build'
> iconv#2.3.1 install /tmp/build_c3cb8f26de145fdc95dbb7c74ca4abea/node_modules/iconv
> node-gyp rebuild
make: Entering directory '/tmp/build_c3cb8f26de145fdc95dbb7c74ca4abea/node_modules/iconv/build'
CXX(target) Release/obj.target/iconv/src/binding.o
CC(target) Release/obj.target/iconv/deps/libiconv/lib/iconv.o
CC(target) Release/obj.target/iconv/support/localcharset.o
SOLINK_MODULE(target) Release/obj.target/iconv.node
COPY Release/iconv.node
make: Leaving directory '/tmp/build_c3cb8f26de145fdc95dbb7c74ca4abea/node_modules/iconv/build'
> execSync#1.0.2 install /tmp/build_c3cb8f26de145fdc95dbb7c74ca4abea/node_modules/execSync
> node install.js
[execsync v1.0.2] Attempting to compile native extensions.
[execSync v1.0.2]
Native code compile failed!!
added 760 packages from 579 contributors and audited 3610 packages in 38.646s
found 111 vulnerabilities (46 low, 49 moderate, 16 high)
run `npm audit fix` to fix them, or `npm audit` for details
-----> Build
Running build
> udemy-nodejs-angular2#1.0.0 build /tmp/build_c3cb8f26de145fdc95dbb7c74ca4abea
> del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch
0% compiling
Webpack is watching the files…
10% building modules 0/1 modules 1 active ...dc95dbb7c74ca4abea/assets/app/main.ts
[at-loader] Using typescript#2.6.2 from typescript and "tsconfig.json" from /tmp/build_c3cb8f26de145fdc95dbb7c74ca4abea/tsconfig.json.
18812ms building modules
77ms sealing
0ms optimizing
0ms basic module optimization
66ms module optimization
27ms advanced module optimization
0ms basic chunk optimization
0ms chunk optimization
0ms advanced chunk optimization
1ms module and chunk tree optimization
48ms module reviving
6ms module order optimization
9ms module id optimization
10ms chunk reviving
1ms chunk order optimization
45ms chunk id optimization
116ms hashing
1ms module assets processing
1746ms chunk assets processing
6ms additional chunk assets processing
0ms recording
0ms additional asset processing
1ms chunk asset optimization
494ms asset optimization
206ms emitting
Hash: bdcd2d9b22529d57e9ea
Version: webpack 2.7.0
Time: 21715ms
Asset Size Chunks Chunk Names
0.chunk.js 672 kB 0 [emitted] [big]
1.chunk.js 45.2 kB 1 [emitted]
bundle.js 29.8 MB 2 [emitted] [big] app
[0] ./~/#angular/core/esm5/core.js 542 kB {2} [built]
[] -> factory:568ms building:8004ms dependencies:14ms = 8586ms
[4] ./~/tslib/tslib.es6.js 8.03 kB {2} [built]
[] -> factory:1256ms building:1025ms = 2281ms
[46] ./~/#angular/platform-browser/esm5/platform-browser.js 159 kB {2} [built]
[] -> factory:570ms building:4258ms dependencies:5ms = 4833ms
[785] ./~/#angular/platform-browser-dynamic/esm5/platform-browser-dynamic.js 24.9 kB {2} [built]
[] -> factory:96ms building:89ms dependencies:464ms = 649ms
[786] ./assets/app/app.module.ts 4.19 kB {2} [built]
[] -> factory:11ms building:71ms = 82ms
[787] ./assets/app/polyfills.ts 163 bytes {2} [built]
[] -> factory:9ms building:9ms = 18ms
[788] ./~/hammerjs/hammer.js 73.8 kB {2} [built]
[] -> factory:95ms building:643ms = 738ms
[820] ./~/#angular/platform-browser/esm5/animations.js 28 kB {2} [built]
[] -> factory:571ms building:292ms dependencies:499ms = 1362ms
[821] ./assets/app/app.component.ts 1.58 kB {2} [built]
[] -> factory:27ms building:112ms dependencies:431ms = 570ms
[822] ./assets/app/app.routing.ts 3.79 kB {2} [built]
[] -> factory:28ms building:176ms dependencies:12ms = 216ms
[823] ./assets/app/errors/error.component.ts 2.12 kB {2} [built]
[] -> factory:32ms building:343ms dependencies:195ms = 570ms
[825] ./assets/app/header.component.ts 1.53 kB {2} [built]
[] -> factory:28ms building:129ms dependencies:413ms = 570ms
[826] ./assets/app/main.ts 338 bytes {2} [built]
factory:30ms building:7552ms = 7582ms
[830] ./assets/app/messages/message.module.ts 1.78 kB {2} [built]
[] -> factory:34ms building:372ms dependencies:1123ms = 1529ms
[832] ./assets/app/setup/job.module.ts 4.54 kB {2} [built]
[] -> factory:36ms building:471ms dependencies:1277ms = 1784ms
+ 1707 hidden modules
-----> Timed out running buildpack Node.js
! Timed out compiling app (60 minutes)
! See https://devcenter.heroku.com/articles/slug-compiler#time-limit
I see that there is a statement that says Module installation may take longer for this build but unfortunately it is timing out. The frustrating part here is that it used to work and I'm not sure why it isn't now. Is there any way to increase the timeout limit or solve this issue in another way?
This is probably due to the webpack build taking time due to high memory usage. You can try to tweak the memory allowed for the node process by passing NODE_OPTIONS="--max_old_space_size=2560". The default size is 2.5GB and you can try increasing it to a suitable value. Might help!

Failed to load external module #babel/register while gulp

In my react project everything works fine on my vmware. But when I cloned the same app and ran gulp command I am getting this error during compilation saying
MacBook-Pro:Frontend1.0 apurvgandhwani$ gulp
[18:42:31] Failed to load external module #babel/register
[18:42:31] Requiring external module babel-register
[18:42:32] Using gulpfile ~/Frontend1.0/gulpfile.babel.js
[18:42:32] Starting 'build:watch'...
[18:42:32] Starting 'copy:assets'...
[18:42:32] Starting 'copy:vendors'...
Cleaned build/
Copied 12 asset entries.
[18:42:32] Finished 'copy:vendors' after 329 ms
[18:42:32] Starting 'copy:views'...
[18:42:32] copied views all files 19.75 kB
[18:42:32] Finished 'copy:views' after 77 ms
[18:42:32] Starting 'copy:public'...
[18:42:33] Finished 'copy:public' after 132 ms
[18:42:33] Finished 'copy:assets' after 540 ms
[18:42:33] Starting 'bundle:dll'...
DLL Bundled.
Hash: 45f26d608c690be6e6c5
Version: webpack 1.15.0
Time: 2181ms
Asset Size Chunks Chunk Names
dll.vendor.js 3.11 MB 0 [emitted] vendor
[18:42:35] Finished 'bundle:dll' after 2.21 s
[18:42:35] Starting 'bundle'...
Hash: 7457a3cd38cf5c991640
Version: webpack 1.15.0
Time: 508ms
Asset Size Chunks Chunk Names
server-bundle.js 37.3 kB 0 [emitted] main
-- server:watch bundled.
Hash: e4a95c52aac91b47f75c
Version: webpack 1.15.0
Time: 46339ms
Asset Size Chunks Chunk Names
main-bundle.js 20.1 MB 0 [emitted] main
-- client bundled.
[18:43:21] Finished 'bundle' after 46 s
[18:43:21] Starting 'start:server'...
Starting Node Server...
[18:43:21] Finished 'start:server' after 68 ms
[18:43:21] Starting 'watch:sync'...
[18:43:21] [nodemon] 1.11.0
[18:43:21] [nodemon] to restart at any time, enter `rs`
[18:43:21] [nodemon] watching: build/server-bundle.js
[18:43:21] [nodemon] starting `node --debug build/server-bundle.js`
Server Restarted: Reloading BrowserSync.
(node:6700) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.
[18:43:21] [nodemon] app crashed - waiting for file changes before starting...
[tessact: ] Proxying: http://localhost:4200
[tessact: ] Access URLs:
-------------------------------------
Local: http://localhost:3001
External: http://192.168.0.32:3001
-------------------------------------
UI: http://localhost:3002
UI External: http://192.168.0.32:3002
-------------------------------------
[tessact: ] Watching files...
[18:43:21] Finished 'watch:sync' after 262 ms
[18:43:21] Starting 'watch:assets'...
[18:43:22] Finished 'watch:assets' after 110 ms
[18:43:22] Finished 'build:watch' after 50 s
[18:43:22] Starting 'default'...
[18:43:22] Finished 'default' after 37 μs
webpack built e4a95c52aac91b47f75c in 26323ms
Hash: e4a95c52aac91b47f75c
Version: webpack 1.15.0
Time: 26323ms
Asset Size Chunks Chunk Names
main-bundle.js 20.1 MB 0 main
webpack: Compiled successfully.
[18:50:28] [nodemon] restarting due to changes...
[18:50:28] [nodemon] starting `node --debug build/server-bundle.js`
Server Restarted: Reloading BrowserSync.
[tessact: ] Reloading Browsers...
(node:6705) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.
[18:50:28] [nodemon] app crashed - waiting for file changes before starting...
Abort trap: 6
This is my package.json snippet
"dependencies": {
"#trendmicro/react-toggle-switch": "^0.5.5",
"animate.css": "^3.5.1",
"axis": "^0.6.1",
"babel-core": "^6.10.4",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"babel-preset-react-hmre": "^1.1.1",
I have followed a lot of threads but nothing seems to solve my case. What should I do to solve this? I already have babel-core instead of babel in my package.json which most of the solutions suggest.
I have solved it by downgrading the gulp version from 3.9.1 to 3.9.0. Looks like 3.9.1 is buggy.
This is just a warning that Gulp failed to load #babel/register but on the next line it successfully loaded the fallback module: babel-register
https://github.com/gulpjs/gulp/issues/1631
You could install the babel-core/register module to remove the warning, but it's not necessary.
You can remove the error with npm i -D babel-register (i = shorthand for install, D = shorthand for --save-dev)

On Windows, wepback build is blocked during 'emit' phase

I created a simple webpack project for a Typescript library : https://github.com/lbar/test-webpackts-issue
On linux, npm run build finishes successfully:
> rimraf dist && webpack --progress --profile
10% 0/1 build modulests-loader: Using typescript#1.8.10 and /tmp/testwebpack/tsconfig.json 8030ms1217ms optimi5ms emit
Hash: 8eac1502f3b7a9a19be2
Version: webpack 1.13.1
Time: 2596ms
Asset Size Chunks Chunk Names
index.js 816 bytes 0 [emitted] index
index.js.map 6.07 kB 0 [emitted] index
/tmp/testwebpack/dist/index.d.ts 31 bytes [emitted]
/tmp/testwebpack/dist/src/info.d.ts 49 bytes [emitted]
+ 2 hidden modules
On Windows, npm run build is blocked during 'emit' phase. The output is :
> rimraf dist && webpack --progress --profile
10% 0/1 build modulests-loader: Using typescript#1.8.10 and C:\tmp\testwebpack\tsconfig.jso
1836ms build modules
3ms seal
7ms optimize
3ms hashing
7ms create chunk assets
79ms additional chunk assets
19ms optimize chunk assets
837ms optimize assets
95% emit
The version of node differs: 6.2.2 on Windows and 4.4.5 on Linux. I don't know if it may be the cause.
Has anyone an idea about the problem? Issue in webpack, ts-loader or typescript?
One more thing, call to tsc is working on both systems.
Thanks for your help
This problem is caused by an issue in ts-loader: https://github.com/TypeStrong/ts-loader/issues/185
A Pull Request is waiting fixes for project core team.
Webpack can use "awesome-typescript-loader" to avoid this issue.

Resources