gulp 4 spawn fails when building KSS - node.js

I'm trying to resurrect my automated KSS build process which died a year ago after I upgraded Node for another project.
KSS works fine when I run it directly via the command line ($ ./node_modules/kss/bin/kss --config kss-config.json)
But when I run it via gulp using node spawn I get the following error:
user#computer /c/users/user/Documents/projects/kss
$ gulp
[12:04:42] Using gulpfile C:\users\user\Documents\projects\kss\gulpfile.js
[12:04:42] Starting 'default'...
[12:04:42] Starting 'compileKss'...
[12:04:42] 'compileKss' errored after 3.21 ms
[12:04:42] Error: spawn ./node_modules/kss/bin/kss ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
[12:04:42] 'default' errored after 6.78 ms
My gulp file looks like this:
'use strict'
/**
* Some useful links to help with understanding this file:
* * https://www.webstoemp.com/blog/switching-to-gulp4/
*/
const { series } = require('gulp')
const childProcess = require('child_process')
/**
* a Gulp task for compiling Sass files to CSS and creating source maps
*/
const compileKss = (gulpCallBack) => {
const kss = childProcess.spawn(
'./node_modules/kss/bin/kss',
[
'--config',
'./kss-config.json'
]
)
kss.on('exit', (code) => {
const errorMsg = (code === 0) ? null : 'ERROR: kss-node process exited with code: ' + code
gulpCallBack(errorMsg)
})
return kss
}
exports.default = series(compileKss)
and my kss config file looks like this:
{
"title": "KSS style guide",
"source": [
"./style-guide/css/"
],
"destination": "./style-guide/",
"homepage": "src/homepage.md",
"builder": "node_modules/michelangelo/kss_styleguide/custom-template",
"css": [],
"js": []
}
and my package.json looks like this:
{
"name": "KSS style-guide",
"description": "KSS style-guide",
"author": {},
"browserslist": [
"last 2 version",
"> 1%"
],
"bugs": {},
"contributors": [],
"dependencies": {},
"devDependencies": {
"acorn": "^7.1.0",
"browser-sync": "^2.26.7",
"compass-importer": "^0.4.1",
"concat": "^1.0.3",
"del": "^5.1.0",
"fancy-log": "^1.3.3",
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-plumber": "^1.2.1",
"gulp-sass": "^4.0.2",
"gulp-sass-lint": "^1.4.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-terser": "^1.2.0",
"gulp-uglify": "^3.0.2",
"kss": "^3.0.0-beta.25",
"michelangelo": "^0.8.0",
"standard": "^14.3.1",
"terser": "^4.3.9"
},
"engines": {"node": ">=12"},
"engineStrict": true,
"repository": {},
"scripts": {},
"version": "0.0.1"
}
FYI: My system is using
Windows: 10 (10.0.16299)
Git Bash (mintty 3.0.6) (GNU bash, version 4.4.23(1)-release (x86_64-pc-msys))
Node: 12.13.0
Gulp: 4.0.2
kss-node: 3.0.0-beta.25

Related

app threw an error during load after installing sqlite3 (electronjs)

after installing sqlite3 in electron app and writing code to create database, app returns error and doesn't start
error returned:
Error: Cannot find module 'C:\Users\web_walkerX\Documents\Techdroid\Desktop\cranesoft-desktop - Copy\node_modules\sqlite3\lib\binding\napi-v3-win32-unknown-x64\node_sqlite3.node'
at Module._resolveFilename (internal/modules/cjs/loader.js:584:15)
at Function.Module._resolveFilename (C:\Users\web_walkerX\Documents\Techdroid\Desktop\cranesoft-desktop - Copy\node_modules\electron\dist\resources\electron.asar\common\reset-search-paths.js:43:12)
at Function.Module._load (internal/modules/cjs/loader.js:510:25)
at Module.require (internal/modules/cjs/loader.js:640:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\Users\web_walkerX\Documents\Techdroid\Desktop\cranesoft-desktop - Copy\node_modules\sqlite3\lib\sqlite3-binding.js:4:17)
at Object.<anonymous> (C:\Users\web_walkerX\Documents\Techdroid\Desktop\cranesoft-desktop - Copy\node_modules\sqlite3\lib\sqlite3-binding.js:7:3)
at Module._compile (internal/modules/cjs/loader.js:693:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:704:10)
at Module.load (internal/modules/cjs/loader.js:602:32)
see image below
code to create local DB
const createLocalDB = () => {
let db = new sqlite3.Database("../../data/cranesoft.sqlite3", (err) => {
if (err) {
console.log('Error when creating the database', err)
} else {
console.log('Database created!')
/* Put code to create table(s) here */
// createTable()
}
})
}
createLocalDB()
module.exports = createLocalDB
I have sqlite installed locally and it works without problem, all commands work as expected. I can create dbs from the shell and the rest
Below is an image of sqlite working from the shell
Several SO answers say to run "rebuild": "electron-rebuild -f -w sqlite3" after sqlite3 installation, doing this returns the following error
I have also tried "postinstall": "electron-builder install-app-deps" which didn't work
I have also tried the intructions on https://github.com/nodejs/node-gyp to build node-gyp,
I installed visual studio 2022 (desktop development with c++ selected), all relevant development SDKs and libraries were installed yet sqlite error persists
this is my package.json
"name": "appname",
"version": "1.0.0",
"description": "play",
"main": "main.js",
"scripts": {
"start": "electron .",
"postinstall": "electron-builder install-app-deps",
"pack": "electron-builder --dir",
"dist": "electron-builder",
"rebuild": "electron-rebuild -f -w sqlite3"
},
"repository": "",
"keywords": [
"palymaker"
],
"author": "Playmaker Systems",
"license": "CC0-1.0",
"dependencies": {
"axios": "^0.24.0",
"bootstrap": "^3.3.5",
"ejs": "^3.0.1",
"ejs-electron": "^2.1.1",
"electron-print-dialog": "0.1.0-alpha.1",
"electron-router": "^0.5.1",
"electron-squirrel-startup": "^1.0.0",
"express": "^4.17.1",
"jquery": "^3.3.1",
"mysql2": "^2.3.3",
"nodemon": "^2.0.2",
"sequelize": "^6.9.0",
"twbs-pagination": "^1.4.2"
},
"devDependencies": {
"browser-sync": "2.26.3",
"electron": "^4.2.12",
"electron-builder": "^22.14.13",
"electron-rebuild": "^3.2.7",
"gulp": "4.0.0",
"sqlite3": "^5.0.8"
},
"build": {
"appId": "com.palymaker.appname",
"dmg": {
"contents": [
{
"x": 110,
"y": 150
},
{
"x": 240,
"y": 150,
"type": "link",
"path": "/Applications"
}
]
},
"linux": {
"target": [
"AppImage",
"deb"
]
},
"win": {
"target": [
"nsis",
"msi"
],
"icon": "build/appname-icon.ico"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true,
"installerIcon": "build/appname-icon.ico",
"uninstallerIcon": "build/appname-icon.ico",
"deleteAppDataOnUninstall": true,
"runAfterFinish": true,
"createDesktopShortcut": "always",
"createStartMenuShortcut": true,
"shortcutName": "appnameDesktop",
"allowElevation": true
}
}
}
Operating system: Windows 10
node version: 14.17.5
All help is appreciated

Deploying Svelte App to Heroku / Dokku fails because modules cannot be found

I am having problems deploying my svelte web3 App to my VPS running Dokku.
The structure of the folder is as follows:
root
|-->svelte
|--> ...
I found some solutions to work with the two folders needing npm install around here. So I put:
"heroku-postbuild": "cd ./svelte && npm install && npm run build" and "cacheDirectories": ["./node_modules", "./svelte/node_modules"] in the root package.json.
But when the process comes to this point it fails with the following error:
remote: [!] Error: Cannot find module '#rollup/plugin-node-resolve'
remote: Require stack:
remote: - /tmp/build/svelte/rollup.config.js
remote: - /tmp/build/svelte/node_modules/rollup/dist/shared/loadConfigFile.js
remote: - /tmp/build/svelte/node_modules/rollup/dist/bin/rollup
I've tried changing the import to include the full paths etc. but nothing has worked so far. I have also changed the order of the imports, but the process fails with the first import in the rollup.config.
Any ideas?
package.json root:
"scripts": {
"heroku-postbuild": "cd ./svelte && npm install && npm run build"
},
"dependencies": {
"#openzeppelin/contracts": "^4.6.0",
"#truffle/hdwallet-provider": "^2.0.8",
"babel-polyfill": "^6.26.0",
"babel-register": "^6.26.0",
"dotenv": "^16.0.0",
"web3": "^1.7.3"
},
"cacheDirectories": ["./node_modules", "./svelte/node_modules"],
"engines": {
"node": "16.14",
"npm": "8.7.x"
}
}
package.json svelte (added all the dev dependencies again just in case)
{
"name": "app",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"start": "sirv public --no-clear"
},
"devDependencies": {
"#rollup/plugin-commonjs": "^17.0.0",
"#rollup/plugin-node-resolve": "^11.0.0",
"rollup": "^2.3.4",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"svelte": "^3.0.0"
},
"dependencies": {
"rollup-plugin-terser": "^7.0.0",
"svelte": "^3.0.0",
"#rollup/plugin-commonjs": "^17.0.0",
"#rollup/plugin-node-resolve": "^11.0.0",
"rollup-plugin-css-only": "^3.1.0",
"rollup": "^2.3.4",
"rollup-plugin-svelte": "^7.0.0",
"#rollup/plugin-json": "^4.1.0",
"apexcharts": "^3.35.0",
"bootstrap": "^5.1.3",
"moment": "^2.29.2",
"rollup-plugin-copy": "^3.4.0",
"sirv-cli": "^2.0.0",
"svelte-web3": "^3.4.0"
}
}
rollup.config.js
import resolve from '#rollup/plugin-node-resolve';
import { nodeResolve } from '#rollup/plugin-node-resolve';
import svelte from 'node_modules/rollup-plugin-svelte';
import commonjs from 'node_modules/#rollup/plugin-commonjs';
import livereload from 'node_modules/rollup-plugin-livereload';
import { terser } from 'node_modules/rollup-plugin-terser';
import css from 'node_modules/rollup-plugin-css-only';
import json from 'node_modules/#rollup/plugin-json';
import copy from 'node_modules/rollup-plugin-copy'
const production = !process.env.ROLLUP_WATCH;
function serve() {
let server;
function toExit() {
if (server) server.kill(0);
}
return {
writeBundle() {
if (server) return;
server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
stdio: ['ignore', 'inherit', 'inherit'],
shell: true
});
process.on('SIGTERM', toExit);
process.on('exit', toExit);
}
};
}
export default {
input: 'src/main.js',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/build/bundle.js'
},
plugins: [
svelte({
compilerOptions: {
// enable run-time checks when not in production
dev: !production
}
}),
// we'll extract any component CSS out into
// a separate file - better for performance
css({ output: 'bundle.css' }),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration -
// consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve({
browser: true,
dedupe: ['svelte']
}),
commonjs(),
json(),
nodeResolve(),
copy({
targets: [{
src: './node_modules/bootstrap/dist/**/*',
dest: 'public/vendor/bootstrap'
}]
}),
// In dev mode, call `npm run start` once
// the bundle has been generated
!production && serve(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload('public'),
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser()
],
watch: {
clearScreen: false
}
};
```

Can't compile sqlite3 as a native addon, Electron React Boilerplate project

I'm building a project based off the Electron React Boilerplate project. I am running MacOS 10.15.7 and node v14.15.1.
I'm trying to install sqlite3 package. Since it's a native dependency, I ran yarn add sqlite3 inside the src/ directory, like it says to do here. The compilation fails with the following output:
henryoconnor#Henrys-MacBook-Pro-5 src % yarn add sqlite3
yarn add v1.22.10
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...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ sqlite3#5.0.2
info All dependencies
└─ sqlite3#5.0.2
$ yarn electron-rebuild
yarn run v1.22.10
$ node -r ../.erb/scripts/BabelRegister.js ../.erb/scripts/ElectronRebuild.js
⠴ Building modules: 0/1gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
⠦ Building modules: 0/1gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args '/Users/henryoconnor/Documents/secretary/electron-app/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/sqlite3/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/henryoconnor/Documents/secretary/electron-app/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/henryoconnor/.electron-gyp/11.3.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/henryoconnor/.electron-gyp/11.3.0',
gyp info spawn args '-Dnode_gyp_dir=/Users/henryoconnor/Documents/secretary/electron-app/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/henryoconnor/.electron-gyp/11.3.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/sqlite3',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
⠸ Building modules: 0/1No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
⠴ Building modules: 0/1gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
⠧ Building modules: 0/1 LIBTOOL-STATIC Release/nothing.a
⠋ Building modules: 0/1 ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c
⠼ Building modules: 0/1 TOUCH Release/obj.target/deps/action_before_build.stamp
⠴ Building modules: 0/1 CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3340000/sqlite3.o
⠸ Building modules: 0/1 LIBTOOL-STATIC Release/sqlite3.a
⠴ Building modules: 0/1 CXX(target) Release/obj.target/node_sqlite3/src/backup.o
⠹ Building modules: 0/1In file included from ../src/backup.cc:2:
In file included from /Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/node-addon-api/napi.h:2636:
/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/node-addon-api/napi-inl.h:1575:24: error: use of undeclared
identifier 'napi_is_detached_arraybuffer'; did you mean 'napi_is_arraybuffer'?
napi_status status = napi_is_detached_arraybuffer(_env, _value, &detached);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
napi_is_arraybuffer
/Users/henryoconnor/.electron-gyp/11.3.0/include/node/js_native_api.h:383:25: note: 'napi_is_arraybuffer' declared here
NAPI_EXTERN napi_status napi_is_arraybuffer(napi_env env,
^
In file included from ../src/backup.cc:2:
In file included from /Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/node-addon-api/napi.h:2636:
/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/node-addon-api/napi-inl.h:1581:24: error: use of undeclared
identifier 'napi_detach_arraybuffer'
napi_status status = napi_detach_arraybuffer(_env, _value);
^
⠴ Building modules: 0/1../src/backup.cc:179:9: warning: unused variable 'status' [-Wunused-variable]
int status = napi_create_async_work(
^
../src/backup.cc:252:5: warning: unused variable 'status' [-Wunused-variable]
BACKUP_BEGIN(Step);
^
../src/macros.h:182:9: note: expanded from macro 'BACKUP_BEGIN'
int status = napi_create_async_work( \
^
../src/backup.cc:319:5: warning: unused variable 'status' [-Wunused-variable]
BACKUP_BEGIN(Finish);
^
../src/macros.h:182:9: note: expanded from macro 'BACKUP_BEGIN'
int status = napi_create_async_work( \
^
⠧ Building modules: 0/13 warnings and 2 errors generated.
make: *** [Release/obj.target/node_sqlite3/src/backup.o] Error 1
✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild '/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/sqlite3'.
Error: `make` failed with exit code: 2
Error: node-gyp failed to rebuild '/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/sqlite3'.
Error: `make` failed with exit code: 2
at ModuleRebuilder.rebuildNodeGypModule (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/electron-rebuild/lib/src/module-rebuilder.js:193:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Rebuilder.rebuildModuleAt (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/electron-rebuild/lib/src/rebuild.js:190:9)
at async Promise.all (index 105)
at async Rebuilder.rebuild (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/electron-rebuild/lib/src/rebuild.js:148:13)
at async /Users/henryoconnor/Documents/secretary/electron-app/node_modules/electron-rebuild/lib/src/cli.js:146:9
child_process.js:655
throw err;
^
Error: Command failed: ../node_modules/.bin/electron-rebuild --parallel --force --types prod,dev,optional --module-dir .
at checkExecSyncError (child_process.js:616:11)
at execSync (child_process.js:652:15)
at Object.<anonymous> (/Users/henryoconnor/Documents/secretary/electron-app/.erb/scripts/ElectronRebuild.js:18:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Module._compile (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Object.newLoader [as .js] (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
status: 255,
signal: null,
output: [ null, null, null ],
pid: 9189,
stdout: null,
stderr: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
package.json
{
"name": "secretary",
"productName": "Secretary",
"description": "A personal secretary for handling daily work.",
"scripts": {
"build": "concurrently \"yarn build:main\" \"yarn build:renderer\"",
"build:main": "cross-env NODE_ENV=production webpack --config ./.erb/configs/webpack.config.main.prod.babel.js",
"build:renderer": "cross-env NODE_ENV=production webpack --config ./.erb/configs/webpack.config.renderer.prod.babel.js",
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir src",
"lint": "cross-env NODE_ENV=development eslint . --cache --ext .js,.jsx,.ts,.tsx",
"package": "rm -rf src/dist && yarn build && electron-builder build --publish never",
"postinstall": "node -r #babel/register .erb/scripts/CheckNativeDep.js && electron-builder install-app-deps && yarn cross-env NODE_ENV=development webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.babel.js && opencollective-postinstall && yarn-deduplicate yarn.lock",
"start": "node -r #babel/register ./.erb/scripts/CheckPortInUse.js && cross-env yarn start:renderer",
"start:main": "cross-env NODE_ENV=development electron -r ./.erb/scripts/BabelRegister ./src/main.dev.ts",
"start:renderer": "cross-env NODE_ENV=development webpack serve --config ./.erb/configs/webpack.config.renderer.dev.babel.js",
"test": "jest"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"cross-env NODE_ENV=development eslint --cache"
],
"{*.json,.{babelrc,eslintrc,prettierrc}}": [
"prettier --ignore-path .eslintignore --parser json --write"
],
"*.{css,scss}": [
"prettier --ignore-path .eslintignore --single-quote --write"
],
"*.{html,md,yml}": [
"prettier --ignore-path .eslintignore --single-quote --write"
]
},
"build": {
"productName": "Secretary",
"appId": "secretary",
"files": [
"dist/",
"node_modules/",
"index.html",
"main.prod.js",
"main.prod.js.map",
"package.json"
],
"afterSign": ".erb/scripts/Notarize.js",
"mac": {
"target": [
"dmg"
],
"type": "distribution",
"hardenedRuntime": true,
"entitlements": "assets/entitlements.mac.plist",
"entitlementsInherit": "assets/entitlements.mac.plist",
"gatekeeperAssess": false
},
"dmg": {
"contents": [
{
"x": 130,
"y": 220
},
{
"x": 410,
"y": 220,
"type": "link",
"path": "/Applications"
}
]
},
"win": {
"target": [
"nsis"
]
},
"linux": {
"target": [
"AppImage"
],
"category": "Development"
},
"directories": {
"app": "src",
"buildResources": "assets",
"output": "release"
},
"extraResources": [
"./assets/**"
],
"publish": {
"provider": "github",
"owner": "electron-react-boilerplate",
"repo": "electron-react-boilerplate"
}
},
"jest": {
"testURL": "http://localhost/",
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/.erb/mocks/fileMock.js",
"\\.(css|less|sass|scss)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"js",
"jsx",
"ts",
"tsx",
"json"
],
"moduleDirectories": [
"node_modules",
"src/node_modules"
],
"setupFiles": [
"./.erb/scripts/CheckBuildsExist.js"
]
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/plugin-proposal-class-properties": "^7.12.1",
"#babel/plugin-proposal-decorators": "^7.12.1",
"#babel/plugin-proposal-do-expressions": "^7.12.1",
"#babel/plugin-proposal-export-default-from": "^7.12.1",
"#babel/plugin-proposal-export-namespace-from": "^7.12.1",
"#babel/plugin-proposal-function-bind": "^7.12.1",
"#babel/plugin-proposal-function-sent": "^7.12.1",
"#babel/plugin-proposal-json-strings": "^7.12.1",
"#babel/plugin-proposal-logical-assignment-operators": "^7.12.1",
"#babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
"#babel/plugin-proposal-optional-chaining": "^7.12.7",
"#babel/plugin-proposal-pipeline-operator": "^7.12.1",
"#babel/plugin-proposal-throw-expressions": "^7.12.1",
"#babel/plugin-syntax-dynamic-import": "^7.8.3",
"#babel/plugin-syntax-import-meta": "^7.10.4",
"#babel/plugin-transform-react-constant-elements": "^7.12.1",
"#babel/plugin-transform-react-inline-elements": "^7.12.1",
"#babel/plugin-transform-runtime": "^7.12.1",
"#babel/preset-env": "^7.12.7",
"#babel/preset-react": "^7.12.7",
"#babel/preset-typescript": "^7.12.7",
"#babel/register": "^7.12.1",
"#pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"#teamsupercell/typings-for-css-modules-loader": "^2.4.0",
"#testing-library/jest-dom": "^5.11.6",
"#testing-library/react": "^11.2.2",
"#types/enzyme": "^3.10.5",
"#types/enzyme-adapter-react-16": "^1.0.6",
"#types/history": "4.7.6",
"#types/jest": "^26.0.15",
"#types/node": "14.14.10",
"#types/react": "^16.9.44",
"#types/react-dom": "^16.9.9",
"#types/react-router-dom": "^5.1.6",
"#types/react-test-renderer": "^16.9.3",
"#types/webpack-env": "^1.15.2",
"#typescript-eslint/eslint-plugin": "^4.8.1",
"#typescript-eslint/parser": "^4.8.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.1.0",
"babel-loader": "^8.2.2",
"babel-plugin-dev-expression": "^0.2.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"browserslist-config-erb": "^0.0.1",
"chalk": "^4.1.0",
"concurrently": "^5.3.0",
"core-js": "^3.6.5",
"cross-env": "^7.0.2",
"css-loader": "^5.0.1",
"css-minimizer-webpack-plugin": "^1.1.5",
"detect-port": "^1.3.0",
"electron": "^11.0.1",
"electron-builder": "^22.3.6",
"electron-devtools-installer": "^3.1.1",
"electron-notarize": "^1.0.0",
"electron-rebuild": "^2.3.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.3",
"enzyme-to-json": "^3.5.0",
"eslint": "^7.5.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-airbnb-typescript": "^12.0.0",
"eslint-config-erb": "^2.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-import-resolver-webpack": "^0.13.0",
"eslint-plugin-compat": "^3.8.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.0.8",
"file-loader": "^6.0.0",
"husky": "^4.2.5",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.1.0",
"lint-staged": "^10.2.11",
"mini-css-extract-plugin": "^1.3.1",
"node-sass": "^5.0.0",
"opencollective-postinstall": "^2.0.3",
"prettier": "^2.0.5",
"react-refresh": "^0.9.0",
"react-test-renderer": "^17.0.1",
"rimraf": "^3.0.0",
"sass-loader": "^10.1.0",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.0.3",
"typescript": "^4.0.5",
"url-loader": "^4.1.0",
"webpack": "^5.5.1",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^5.4.0",
"yarn-deduplicate": "^3.1.0"
},
"dependencies": {
"#fullcalendar/daygrid": "^5.5.0",
"#fullcalendar/react": "^5.5.0",
"#getstation/electron-google-oauth2": "^2.1.0",
"#reduxjs/toolkit": "^1.5.0",
"#tippyjs/react": "^4.2.0",
"electron-debug": "^3.1.0",
"electron-log": "^4.2.4",
"electron-updater": "^4.3.4",
"googleapis": "^67.1.0",
"history": "^5.0.0",
"jquery": "^3.5.1",
"js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-modal": "^3.12.1",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.7",
"reselect": "^4.0.0",
"sanitize-html": "^2.3.2",
"source-map-support": "^0.5.19",
"styled-components": "^5.2.1"
},
"devEngines": {
"node": ">=10.x",
"npm": ">=6.x",
"yarn": ">=1.21.3"
},
"browserslist": [],
"prettier": {
"overrides": [
{
"files": [
".prettierrc",
".babelrc",
".eslintrc"
],
"options": {
"parser": "json"
}
}
],
"singleQuote": true
},
"renovate": {
"extends": [
"bliss"
],
"baseBranches": [
"next"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
src/package.json
{
"name": "electron-react-boilerplate",
"productName": "electron-react-boilerplate",
"version": "2.3.0",
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"main": "./main.prod.js",
"author": {
"name": "Electron React Boilerplate Maintainers",
"email": "electronreactboilerplate#gmail.com",
"url": "https://github.com/electron-react-boilerplate"
},
"scripts": {
"electron-rebuild": "node -r ../.erb/scripts/BabelRegister.js ../.erb/scripts/ElectronRebuild.js",
"postinstall": "yarn electron-rebuild"
},
"license": "MIT",
"dependencies": {
"sqlite": "^4.0.19",
"sqlite3": "^5.0.2"
}
}
I downgraded the sqlite3 package to v5.0.0 and it rebuilt correctly. Hope this helps anyone else with the same issue.
Source: nodejs electronjs sqlite3 - use of undeclared identifier 'napi_is_detached_arraybuffer'

Unable to find `../config/paths` and `../config/env`

I am trying to convert React.js web app to desktop app through Electron. Please find the error trace, scripts/start.js, and package.json. When I comment out require('../config/env'); it starts giving same error on const paths = require('../config/paths');
start.js
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const fs = require('fs');
const chalk = require('chalk');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const clearConsole = require('react-dev-utils/clearConsole');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const {
choosePort,
createCompiler,
prepareProxy,
prepareUrls,
} = require('react-dev-utils/WebpackDevServerUtils');
const openBrowser = require('react-dev-utils/openBrowser');
const paths = require('../config/paths');
const config = require('../config/webpack.config.dev');
const createDevServerConfig = require('../config/webpackDevServer.config');
const useYarn = fs.existsSync(paths.yarnLockFile);
const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1);
}
// Tools like Cloud9 rely on this.
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
const HOST = process.env.HOST || '0.0.0.0';
if (process.env.HOST) {
console.log(
chalk.cyan(
`Attempting to bind to HOST environment variable: ${chalk.yellow(
chalk.bold(process.env.HOST)
)}`
)
);
console.log(
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
);
console.log(`Learn more here: ${chalk.yellow('bitLyLink')}`);
console.log();
}
// We attempt to use the default port but if it is busy, we offer the user to
// run on a different port. `choosePort()` Promise resolves to the next free port.
choosePort(HOST, DEFAULT_PORT)
.then(port => {
if (port == null) {
// We have not found a port.
return;
}
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
const appName = require(paths.appPackageJson).name;
const urls = prepareUrls(protocol, HOST, port);
// Create a webpack compiler that is configured with custom messages.
const compiler = createCompiler(webpack, config, appName, urls, useYarn);
// Load proxy config
const proxySetting = require(paths.appPackageJson).proxy;
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
// Serve webpack assets generated by the compiler over a web sever.
const serverConfig = createDevServerConfig(
proxyConfig,
urls.lanUrlForConfig
);
const devServer = new WebpackDevServer(compiler, serverConfig);
// Launch WebpackDevServer.
devServer.listen(port, HOST, err => {
if (err) {
return console.log(err);
}
if (isInteractive) {
clearConsole();
}
console.log(chalk.cyan('Starting the development server...\n'));
openBrowser(urls.localUrlForBrowser);
});
['SIGINT', 'SIGTERM'].forEach(function(sig) {
process.on(sig, function() {
devServer.close();
process.exit();
});
});
})
.catch(err => {
if (err && err.message) {
console.log(err.message);
}
process.exit(1);
});
package.json
{
"name": "utility-core",
"version": "0.1.0",
"private": true,
"main": "public/electron.js",
"homepage": "./",
"dependencies": {
"autoprefixer": "7.1.6",
"axios": "^0.18.0",
"babel-core": "6.26.0",
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",
"babel-loader": "7.1.2",
"babel-preset-react-app": "^3.1.1",
"babel-runtime": "6.26.0",
"bootstrap": "^4.1.3",
"case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "1.1.3",
"concurrently": "^4.1.1",
"css-loader": "0.28.7",
"dotenv": "4.0.0",
"dotenv-expand": "4.2.0",
"electron-is-dev": "^1.1.0",
"eslint": "4.10.0",
"eslint-config-react-app": "^2.1.0",
"eslint-loader": "1.9.0",
"eslint-plugin-flowtype": "2.39.1",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jsx-a11y": "5.1.1",
"eslint-plugin-react": "7.4.0",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"fs-extra": "3.0.1",
"html-webpack-plugin": "2.29.0",
"jest": "20.0.4",
"jquery": "^3.4.1",
"mdbreact": "^4.15.0",
"object-assign": "4.1.1",
"papaparse": "^4.6.0",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.8",
"promise": "8.0.1",
"raf": "3.4.0",
"react": "^16.4.1",
"react-dev-utils": "^5.0.1",
"react-dom": "^16.4.1",
"react-file-reader": "^1.1.4",
"react-router-dom": "^4.2.0",
"react-spinners": "^0.4.6",
"resolve": "1.6.0",
"style-loader": "0.19.0",
"sw-precache-webpack-plugin": "0.11.4",
"universal-cookie": "^3.0.4",
"url-loader": "0.6.2",
"wait-on": "^3.2.0",
"webpack": "3.8.1",
"webpack-dev-server": "2.9.4",
"webpack-manifest-plugin": "1.3.2",
"whatwg-fetch": "2.0.3"
},
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom",
"electron-dev": "concurrently \" cross-env BROWSER=none npm run start\" \"wait-on http://localhost:3000 && electron .\"",
"electron-pack": "build -c.extraMetadata.main=build/electron.js",
"preelectron-pack": "npm run build"
},
"devDependencies": {
"cross-env": "^5.2.0",
"csv-loader": "^3.0.2",
"electron": "^1.8.8",
"electron-builder": "^20.44.4",
"electron-installer-windows": "^2.0.0",
"electron-packager": "^8.7.2"
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,mjs}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}",
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}"
],
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
},
"moduleFileExtensions": [
"web.js",
"js",
"json",
"web.jsx",
"jsx",
"node",
"mjs"
]
},
"babel": {
"presets": [
"env",
"react-app"
],
"plugins": []
},
"eslintConfig": {
"extends": "react-app"
},
"author": "Zain Ul Abideen",
"license": "ISC",
"build": {
"extends": null,
"appId": "com.example.utility-core",
"files": [
"build/**/*",
"node_modules/**/*",
"./public/electron.js"
],
"directories": {
"buildResources": "assets"
}
}
}
Error
D:\Import Utility\fc-import-utility\utility-core>npm run electron-dev
> utility-core#0.1.0 electron-dev D:\Import Utility\fc-import-utility\utility-core
> concurrently " cross-env BROWSER=none npm run start" "wait-on http://localhost:3000 && electron ."
[0]
[0] > utility-core#0.1.0 start D:\Import Utility\fc-import-utility\utility-core
[0] > node scripts/start.js
[0]
[0] internal/modules/cjs/loader.js:613
throw err;
[0] ^
[0]
[0] Error: Cannot find module '../config/paths'
[0] Require stack:
[0] - D:\Import Utility\fc-import-utility\utility-core\scripts\start.js
[0] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
[0] at Function.Module._load (internal/modules/cjs/loader.js:526:27)
[0] at Module.require (internal/modules/cjs/loader.js:666:19)
[0] at require (internal/modules/cjs/helpers.js:16:16)
[0] at Object.<anonymous> (D:\Import Utility\fc-import-utility\utility-core\scripts\start.js:30:15)
[0] at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
[0] at Module.load (internal/modules/cjs/loader.js:628:32)
[0] at Function.Module._load (internal/modules/cjs/loader.js:555:12)
[0] at Function.Module.runMain (internal/modules/cjs/loader.js:822:10)
[0]
[0] npm ERR! Windows_NT 10.0.17134
[0] npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
[0] npm ERR! node v12.2.0
[0] npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
[0] npm ERR! utility-core#0.1.0 start: `node scripts/start.js`
[0] npm ERR! Exit status 1
[0] npm ERR!
[0] npm ERR! Failed at the utility-core#0.1.0 start script 'node scripts/start.js'.
[0] npm ERR! Make sure you have the latest version of node.js and npm installed.
[0] npm ERR! If you do, this is most likely a problem with the utility-core package,
[0] npm ERR! not with npm itself.
[0] npm ERR! Tell the author that this fails on your system:
[0] npm ERR! node scripts/start.js
[0] npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs utility-core
[0] npm ERR! Or if that isn't available, you can get their info via:
[0] npm ERR! npm owner ls utility-core
[0] npm ERR! There is likely additional logging output above.
[0]
[0] npm ERR! Please include the following file with any support request:
[0] npm ERR! D:\Import Utility\fc-import-utility\utility-core\npm-debug.log
[0] cross-env BROWSER=none npm run start exited with code 1

Yarn 1.7 can't start webpack

When trying to open webpack with yarn s I get the following error:
yarn s
yarn run v1.7.0
$ NODE_ENV=development webpack --config webpack.development.js
/bin/sh: webpack: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I tried searching on google for the answer most promising seemed https://gist.github.com/DanHerbert/9520689 but still doesn't work. Anyone has any ideas?
This is my package.json:
cat package.json
{
"name": "Random",
"private": true,
"version": "1.0.0",
"engines": {
"node": "6.9.1",
"yarn": ">=0.27.5"
},
"repository": {
"type": "git",
"url": "random"
},
"scripts": {
"s": "NODE_ENV=development webpack --config webpack.development.js",
"production": "NODE_ENV=production webpack --config webpack.production.js",
"postinstall": "sh -c 'if [ \"${NODE_ENV}\" = \"production\" ]; then yarn run production; fi'",
"precommit:eslint": "git diff-index --cached HEAD --name-only --diff-filter ACMR | grep -E \"\\.jsx?$\" | xargs eslint --quiet"
},
"pre-commit": [
"precommit:eslint"
],
"dependencies": {
"assets-webpack-plugin": "^3.5.1",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "6.11.1",
"classnames": "2.2.5",
"clean-webpack-plugin": "^0.1.16",
"compression-webpack-plugin": "^1.0.0",
"happypack": "^4.0.0-beta.2",
"history": "3.0.0",
"immutable": "3.8.1",
"jquery": "3.1.1",
"json-loader": "0.5.4",
"lodash": "4.17.4",
"moment": "2.19.3",
"moment-timezone": "0.5.11",
"react": "15.3.0",
"react-addons-shallow-compare": "15.3.0",
"react-transition-group": "2.3.1",
"react-big-calendar": "^0.17.0",
"react-bootstrap": "^0.31.5",
"react-d3-cloud": "0.4.1",
"react-datepicker": "0.37.0",
"react-dates": "4.1.0",
"react-dom": "15.3.0",
"react-immutable-render-mixin": "0.9.7",
"react-linkify": "0.1.3",
"react-modal": "1.4.0",
"react-notification-system": "0.2.7",
"react-pagify": "2.0.4",
"react-pagify-preset-bootstrap": "1.0.2",
"react-redux": "4.4.5",
"react-router": "3.0.0",
"react-select": "1.0.0-rc.5",
"react-tag-input": "4.6.2",
"react-text-mask": "^5.0.2",
"redux": "3.6.0",
"redux-form": "6.2.0",
"redux-logger": "2.7.0",
"redux-thunk": "2.1.0",
"seamless-immutable": "^7.1.2",
"strip-ansi": "^4.0.0",
"text-mask-addons": "3.7.1",
"webpack": "^3.5.5"
},
"devDependencies": {
"babel-eslint": "7.1.0",
"eslint": "3.9.0",
"eslint-config-airbnb": "12.0.0",
"eslint-loader": "1.6.1",
"eslint-plugin-import": "1.16.0",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.4.1",
"pre-commit": "1.2.2"
}
}
When I run npm s I get:
npm s
npm ERR! search must be called with arguments
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/luciantarna/.npm/_logs/2018-05-28T13_34_20_437Z-debug.log
cat /Users/luciantarna/.npm/_logs/2018-05-28T13_34_20_437Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/10.2.1/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 's' ]
2 info using npm#5.6.0
3 info using node#v10.2.1
4 verbose stack Error: search must be called with arguments
4 verbose stack at EventEmitter.search (/usr/local/lib/node_modules/npm/lib/search.js:35:15)
4 verbose stack at Object.commandCache.(anonymous function) (/usr/local/lib/node_modules/npm/lib/npm.js:159:13)
4 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:84:30)
4 verbose stack at process._tickCallback (internal/process/next_tick.js:61:11)
5 verbose cwd /Users/luciantarna/govpredict/gov_congress
6 verbose Darwin 17.5.0
7 verbose argv "/usr/local/Cellar/node/10.2.1/bin/node" "/usr/local/bin/npm" "s"
8 verbose node v10.2.1
9 verbose npm v5.6.0
10 error search must be called with arguments
11 verbose exit [ 1, true ]
I don't even know why it gets node 10.2.1 when i installed node6.
I have this in webpack.development.js:
cat webpack.development.js
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const StatusPlugin = require('./front/utils/webpack-status-plugin');
const HappyPack = require('happypack');
const paths = {
src: path.join(__dirname, 'front'),
dest: path.join(__dirname, 'public', 'front'),
};
module.exports = {
context: paths.src,
devtool: 'eval',
entry: {
application: ['babel-polyfill', './application.js'],
admin: ['babel-polyfill', './admin.js'],
portal: ['babel-polyfill', './portal.js'],
},
externals: {
jquery: 'jQuery',
underscore: '_',
},
output: {
path: paths.dest,
filename: '[name].bundle.js',
sourceMapFilename: '[name].js.map',
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'happypack/loader',
},
{
parser: {
amd: false,
},
},
],
},
plugins: [
new CleanWebpackPlugin(paths.dest),
new HappyPack({
loaders: ['babel-loader'],
verbose: false,
}),
StatusPlugin,
],
resolve: {
modules: [paths.src, 'node_modules'],
},
watch: true,
watchOptions: {
ignored: /node_modules/,
},
};
I think you forgot to run npm install
First of all, you'll need to run yarn command, to install the dependencies.

Resources