while installing cosmos gui "npm start" throws error - node.js

[cosmos-gui#cosmos-instance cosmos-gui]$ npm start
cosmos-gui#1.0.0-next start /home/cosmos-gui/fiware-cosmos/cosmos-gui
> node ./src/cosmos_gui.js
/home/cosmos-gui/fiware-cosmos/cosmos-gui/node_modules/express/lib/express.js:110
throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');
^
Error: Most middleware (like logger) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.get (/home/cosmos-gui/fiware-cosmos/cosmos-gui/node_modules/express/lib/express.js:110:13)
at Object. (/home/cosmos-gui/fiware-cosmos/cosmos-gui/src/cosmos_gui.js:66:17)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cosmos-gui#1.0.0-next start: node ./src/cosmos_gui.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cosmos-gui#1.0.0-next 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! /home/cosmos-gui/.npm/_logs/2019-02-13T09_22_21_224Z-debug.log
Any solution for this?

Related

There is a problem when running a node application on ubuntu 18.04

I am trying to run a node site on an azure VM but I get this error when running > SkyCrypt#1.0.0 start
> node init && node index
internal/modules/cjs/loader.js:1109
throw err;
^
SyntaxError: /home/nim1com/SkyCrypt/credentials.json: Unexpected token v in JSON at position 216
at parse (<anonymous>)
at Object.Module._extensions..json (internal/modules/cjs/loader.js:1106:22)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/home/nim1com/SkyCrypt/init.js:15:21)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! SkyCrypt#1.0.0 start: `node init && node index`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the SkyCrypt#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! /home/nim1com/.npm/_logs/2021-01-19T09_41_40_472Z-debug.log```
What would be the answer to this problem? I have tried deleting package-lock.json and node_modules
credentials.json
{
"hypixel_api_key": "26ed366f-80ed-4b49-b912-ef46292c6225",
"recaptcha_site_key": "",
"recaptcha_secret_key": "",
"dbUrl": "mongodb+srv://dbStats:*********#cluster0.4kwsp.mongodb.net/test?retryWrites=true&w=majority",
"dbName": vmstats",
"session_secret": "36e47c144b9b9b3e0b9c8bf24c6ac2860c0f76a55b74dcea4007bf355af76789"
}
It seems your /home/nim1com/SkyCrypt/credentials.json file need to be corrected ...
read the error its complaining about the v in "dbName": vmstats", because is not valid json – Lawrence Cherone

Express-getting this error message trying to run server

I'm trying to run the server on the back-end of a project I'm doing and I keep getting this error message and it stops the server from running. I installed express generator if that makes any difference
> server#0.0.0 start /Users/username/Desktop/project/server
> node ./bin/www
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'http-errors'
Require stack:
- /Users/username/Desktop/project/server/main/app.js
- /Users/username/Desktop/project/server/bin/www
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:747:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/username/Desktop/project/server/main/app.js:1:19)
at Module._compile (internal/modules/cjs/loader.js:1085:30)
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:791:14)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/username/Desktop/project/server/main/app.js',
'/Users/username/Desktop/project/server/bin/www'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server#0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server#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! /Users/username/.npm/_logs/2020-11-13T03_27_43_635Z-debug.log
It clearly says Error: Cannot find module 'http-errors', so you probably don't have the package installed locally. Run npm i http-errors to download it.
Alternatively, if you'd like to save the package as a dependency in your project, run npm i http-errors --save

Not able to install playwright#1.0.2

Hi I am trying to install playwright.
Facing this issue
$ npm i playwright
> playwright#1.0.2 install /Users/chandanj/fr/play-wright-play/node_modules/playwright
> node install.js
internal/util.js:214
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function');
^
TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function
at promisify (internal/util.js:214:11)
at Object.<anonymous> (/Users/chandanj/fr/play-wright-play/node_modules/extract-zip/index.js:11:18)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/chandanj/fr/play-wright-play/node_modules/playwright-core/lib/install/browserFetcher.js:19:17)
npm WARN play-wright#1.0.0 No description
npm WARN play-wright#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! playwright#1.0.2 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the playwright#1.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Not able to figure out what is causing the issue.
Tried with node versions 12.16.3 and 10.20.1

NPM run start, webpack server issue - 'TypeError: Cannot read property 'properties' of undefined'

I am trying to run npm with the command npm run start but I'm getting an error which seems to be happening when the webpack dev server tries to open:
> election#1.0.0 start C:\Users\Aristophanes\election_react\election_react-0.0.1
> webpack-dev-server --open
C:\Users\Aristophanes\election_react\election_react-0.0.1\node_modules\webpack-cli\bin\config-yargs.js:89
describe: optionsSchema.definitions.output.properties.path.description,
^
TypeError: Cannot read property 'properties' of undefined
at module.exports (C:\Users\Aristophanes\election_react\election_react-0.0.1\node_modules\webpack-cli\bin\config-yargs.js:89:48)
at Object.<anonymous> (C:\Users\Aristophanes\election_react\election_react-0.0.1\node_modules\webpack-dev-server\bin\webpack-dev-server.js:84:40)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! election#1.0.0 start: `webpack-dev-server --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the election#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I have run npm install -g webpack-dev-server as this has been the solution for similar errors, but the issue persists. Can anyone help? Thanks.

NPM showing error message after adding the Prop-Types in react project

This is the error message after I finished installation of Prop-Types Validation in my create-react-app
> burgerapp#0.1.0 start C:\Users\ajeet\Desktop\burgerapp
> node scripts/start.js
module.js:540
throw err;
^
Error: Cannot find module 'webpack'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\ajeet\Desktop\burgerapp\scripts\start.js:19:17)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! burgerapp#0.1.0 start: `node scripts/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the burgerapp#0.1.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\ajeet\AppData\Roaming\npm-cache\_logs\2018-02-04T23_43_08_160Z-debug.log
Please help me to find solution. Thank you for your help.
this just sometimes happens with npm when adding packages, especially with create-react-app projects. Delete node_modules and run npm install again, that should fix it.
You can install webpack by using command 'npm install webpack --dev'.

Resources