CUBA Platform Frontend UI update model doesn't work - cuba-platform

I needed to update backend model, so I entered the npm run update-model command but it returns an error:
events.js:292
throw er; // Unhandled ‘error’ event
^
Error: connect ECONNREFUSED 127.0.0.1:*****
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
Emitted ‘error’ event on ClientRequest instance at:
at Socket.socketErrorListener (_http_client.js:469:9)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -61,
code: ‘ECONNREFUSED’,
syscall: ‘connect’,
address: ‘127.0.0.1’,
port: ******
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project2 update-model: gen-cuba-front sdk:all --dest src/cuba
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project2 update-model script.

Probably in Studio integration flag isn't turned on.
Use main menu -> File -> Settings -> CUBA -> Enable integration.

Related

agora npm start command gives me error with Error: spawn cd ENOENT

agora npm start command gives me error with Error: spawn cd ENOENT
can any one help me
`E:\Projects\Full Stack Projects\Video App by Alpha\agora-app-builder\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
throw ex;
^
Error: spawn cd ENOENT
at notFoundError (E:\Projects\Full Stack Projects\Video App by Alpha\agora-app-builder\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (E:\Projects\Full Stack Projects\Video App by Alpha\agora-app-builder\node_modules\cross-spawn\lib\enoent.js:40:16)
at ChildProcess.cp.emit (E:\Projects\Full Stack Projects\Video App by Alpha\agora-app-builder\node_modules\cross-spawn\lib\enoent.js:27:25)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.cp.emit (E:\Projects\Full Stack Projects\Video App by Alpha\agora-app-builder\node_modules\cross-spawn\lib\enoent.js:30:37)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn cd',
path: 'cd',
spawnargs: [ 'videoapp', '&&', 'npm', 'install' ]
}`
I run npm start after npm i and show me this error while I try many times as well with cmd admin

I have trouble with constructing a vue.js project by using npm or yarn

I have trouble with constructing a vue.js project by using npm or yarn.
the cmd: $ vue init webpack my-project
# Installing project dependencies ...
# ========================
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn C:\WINDOWS\system32\cmd.exe; ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn C:\\WINDOWS\\system32\\cmd.exe;',
path: 'C:\\WINDOWS\\system32\\cmd.exe;',
spawnargs: [ '-c', 'yarn install' ]
}
the picture

Issue running express in MERN stack

This is the error I got on running npm start:
F:\Works\Projects\Node\Voice_pres_withbackend\api\node_modules\express\lib\router\index.js:458
throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
^
TypeError: Router.use() requires a middleware function but got a string
at Function.use (F:\Works\Projects\Node\Voice_pres_withbackend\api\node_modules\express\lib\router\index.js:458:13)
at Function.<anonymous> (F:\Works\Projects\Node\Voice_pres_withbackend\api\node_modules\express\lib\application.js:220:21)
at Array.forEach (<anonymous>)
at Function.use (F:\Works\Projects\Node\Voice_pres_withbackend\api\node_modules\express\lib\application.js:217:7)
at Object.<anonymous> (F:\Works\Projects\Node\Voice_pres_withbackend\api\app.js:25:5)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! api#0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the api#0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2020-09-21T14_50_24_855Z-debug.log
This is part of the code the error is pointing to :
var express = require("express");
var router = express.Router();
router.get("/", function (req, res) {
res.send("Api successful");
});
module.exports = router;
Can you please tell me what it is that I'm doing wrong?

TypeError: Cannot read property 'database' of undefined. Any ideas?

I am working at this project https://github.com/ameCont/vue.git
Index.js file:
const fs = require('fs')
const path = require('path')
const Sequelize = require('sequelize')
const config = require('../config/config')
const db = {}
//console.log(config)
const sequelize = new Sequelize(
config.db.database,
config.db.user,
config.db.password,
config.db.options
)
fs
.readdirSync(__dirname)
.filter((file) => {
file !== 'index.js'
}
)
.forEach((file) => {
const model = sequelize.import(path.join(__dirName, file))
db[model.name] = model
})
db.sequelize = sequelize
db.Sequelize = Sequelize
module.exports = db
When I run
npm start
inside server directory I get the error
/home/ubuntu/vue/server/src/models/index.js:10
config.db.database,
^
TypeError: Cannot read property 'database' of undefined
at Object.<anonymous> (/home/ubuntu/vue/server/src/models/index.js:10:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/ubuntu/vue/server/src/app.js:7:21)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
[nodemon] app crashed - waiting for file changes before starting...
My config.js file contains:
module.exports = {
port: process.env.PORT || 8081,
db: {
database: process.env.DB_NAME || 'vue',
user: process.env.DB_USER || 'vue',
password: process.env.DB_PASS || 'vue',
options: {
dialect: process.env.DIALECT || 'sqlite',
host: process.env.HOST || 'localhost',
storage: 'vue.sqlite.sql'
}
}
}
It has || 'vue' so it shouldn't need a real database (I created one but the issue is the same)
I am beginner with vue.
Here JS: firebase.init error: TypeError: Cannot read property 'database' of undefined, the solution was to install some plugins.
But in my case which plugins?
If it helps, when I run
npm install sqlite3
I get this
> sqlite3#4.2.0 install /home/ubuntu/vue/server/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for sqlite3#4.2.0 and node#10.19.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/home/ubuntu/vue/server/node_modules/sqlite3/lib/binding'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ubuntu/vue/server/node_modules/sqlite3/build'
gyp ERR! System Linux 5.4.0-26-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure" "--fallback-to-build" "--module=/home/ubuntu/vue/server/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/ubuntu/vue/server/node_modules/sqlite3/lib/binding/node-v64-linux-x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /home/ubuntu/vue/server/node_modules/sqlite3
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --module=/home/ubuntu/vue/server/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/ubuntu/vue/server/node_modules/sqlite3/lib/binding/node-v64-linux-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/ubuntu/vue/server/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 5.4.0-26-generic
node-pre-gyp ERR! command "/usr/bin/node" "/home/ubuntu/vue/server/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/ubuntu/vue/server/node_modules/sqlite3
node-pre-gyp ERR! node -v v10.19.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --module=/home/ubuntu/vue/server/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/ubuntu/vue/server/node_modules/sqlite3/lib/binding/node-v64-linux-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm WARN eslint-plugin-import#2.20.2 requires a peer of eslint#2.x - 6.x but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-vue#6.2.2 requires a peer of eslint#^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils#3.17.1 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN server#1.0.0 No description
npm WARN server#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3#4.2.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3#4.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Also, this topic doesn't help TypeError: Cannot read property 'database' of undefined
because I do have const config = require('../config/config')
Thanks for help!
Actually, in your config you have two exports, so for correctly accessing it you should name the exported objects:
module.exports.config = {
port: process.env.PORT || 8081,
db: {
database: process.env.DB_NAME || 'vue',
user: process.env.DB_USER || 'vue',
password: process.env.DB_PASS || 'vue',
options: {
dialect: process.env.DIALECT || 'sqlite',
host: process.env.HOST || 'localhost',
storage: 'vue.sqlite.sql'
}
}
}
module.exports.otherConfigs = {
// other configs ..
}
Then in model's index.js you import the configs like that:
const { config, otherConfigs } = require('../config/config')

Why do I get this error trying to run this VUE JS repository?

This is a VUE JS MASONRY project on the GitHub. I just trying to run
it. I've already run the npm install before run it. It seems like the
all the packages have been installed properly.
PS C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master>npm start
> vue-masonry-demo#1.0.0 start C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master
> node build/dev-server.js
> Starting dev server...
events.js:187
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::8080
at Server.setupListenHandle [as _listen2] (net.js:1300:14)
at listenInCluster (net.js:1348:12)
at Server.listen (net.js:1436:7)
at Function.listen (C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master\build\dev-server.js:83:18)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1327:8)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '::',
port: 8080
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-masonry-demo#1.0.0 start: `node build/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-masonry-demo#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-05T22_23_37_278Z-debug.log
PS C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master>
PACKAGE.JSON
{ "name": "vue-masonry-demo", "version": "1.0.0",
"description": "A Vue.js project", "author": "Mikhail Kuznetcov
", "private": true, "scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js" },
Error: listen EADDRINUSE: address already in use :::8080
If you check it here, you will figure it out.