Errors while installing expressjs on windows machine - javascript

I'm following this tutorial to install express JS. http://expressjs.com/2x/guide.html but I'm getting an error while installing the dependencies. Below is my error. Can somebody help me what I'm missing here?
C:\Users\myname\nodejs>npm install -d
npm info it worked if it ends with ok
npm info using npm#1.4.9
npm info using node#v0.10.28
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open 'C:\Users\myname\nodejs\package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directo
ry.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Users\\myname\\nodejs\\\\node.exe" "C:\\Users\\sainath.
g\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d"
npm ERR! cwd C:\Users\myname\nodejs
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path C:\Users\myname\nodejs\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\myname\nodejs\npm-debug.log
npm ERR! not ok code 0
C:\Users\myname\nodejs>node app.js
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\myname\nodejs\app.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3

You are a following a guide to express.js version 2.0 which is deprecated.
The latest express.js version is 4 and this is the guide you should actually follow :
express.js Getting Started Guide

Related

get error from npm when i tried to install parcel

i do a project on nodejs with express and mongodb
so i tried to install parcel but i get this error
npm WARN deprecated stable#0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm ERR! code 1
npm ERR! path C:\Users\Downloads\4-natours\aftersection12\node_modules\lmdb
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp-build-optional-packages
npm ERR! Invalid parameter - 2020\complete-node-bootcamp-master\4-natours\aftersection12\node_modules\.bin\
npm ERR! node:internal/modules/cjs/loader:988
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module 'C:\Users\5MATA\Downloads\node-gyp-build-optional-packages\bin.js'
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:833:27)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR! at node:internal/main/run_main_module:22:47 {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: []
npm ERR! }
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\5MATA\AppData\Local\npm-cache\_logs\2022-11-12T19_37_39_027Z-debug-0.log
whet i can do to solve this error

parse-server fails to start

I have followed the commands below (https://github.com/parse-community/parse-server) to install parse server locally.
$ npm install -g parse-server mongodb-runner
$ mongodb-runner start
$ parse-server --appId myserver --masterKey myserver --databaseURI mongodb://localhost/test
the server files are downloaded and stored at ~/.npm-global/lib/node_modules/parse-server.
when i try to run the 3rd command
parse-server --appId myserver --masterKey myserver --databaseURI mongodb://localhost/test on the terminal, I get the error below
parse-server: command not found
When i try to run npm start on the terminal from the same folder, I get the error below
parse-server#2.7.4 start /home/user/.npm-global/lib/node_modules/parse-server
> node ./bin/parse-server
/home/user/.npm-global/lib/node_modules/parse-server/lib/ParseServer.js:124
const {
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/user/.npm-global/lib/node_modules/parse-server/lib/index.js:8:21)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
npm ERR! Linux 4.4.0-112-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! parse-server#2.7.4 start: `node ./bin/parse-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the parse-server#2.7.4 start script 'node ./bin/parse-server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the parse-server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/parse-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs parse-server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls parse-server
npm ERR! There is likely additional logging output above.
how can i run it?
Another thing, I had already installed mongodb and was using it before trying to install parse-server on my laptop. did
npm install -g parse-server mongodb-runner
mongodb-runner start
install another mongo db on my laptop?
I was able to solve the problem by updating my nodejs version from 4.2.6 to 8.11.1 using the commands below
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
After that, I added parse-server path to /etc/enviroment file
sudo gedit /etc/enviroment
appended this line :~/.npm-global/bin
then I run source /etc/enviroment command
and was able to start parse-server from the terminal
parse-server --appId myserver --masterKey myserver --databaseURI mongodb://localhost/test

Cannot install node.js module

My CI tool uses node version 4.8.3. So I had to roll back my local node.js from 6 to 4.8.3. Now when I do npm install -g I see the following error.
I wasnt facing the error when I was using 6x version but with 4.8.3 I am. Please advice?
C:\Users\jasharma\gitrepo\Protractor Framework\customer-portal>npm install -g
npm WARN deprecated nodemailer#0.7.1: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN engine selenium-webdriver#3.4.0: wanted: {"node":">= 6.9.0"} (current: {"node":"4.8.3","npm":"2.15.11"})
npm WARN peerDependencies The peer dependency karma#>=0.9 included from karma-junit-reporter will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated mimelib#0.2.19: This module is deprecated
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN engine webdriver-manager#10.3.0: wanted: {"node":">=4","npm":">=3"} (current: {"node":"4.8.3","npm":"2.15.11"})
> chromedriver#2.30.1 install C:\Users\jasharma\AppData\Roaming\npm\node_modules\npmpackages\node_modules\chromedriver
> node install.js
module.js:327
throw err;
^
Error: Cannot find module '../dotjs/validate'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\jasharma\AppData\Roaming\npm\node_modules\npmpackages\node_modules\request\node_modules\har-validator\node_modules\ajv\lib\compile\index.js:18:25)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN optional dep failed, continuing fsevents#1.1.2
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g"
npm ERR! node v4.8.3
npm ERR! npm v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! chromedriver#2.30.1 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chromedriver#2.30.1 install script 'node install.js'.
npm ERR! This is most likely a problem with the chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs chromedriver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls chromedriver
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\jasharma\gitrepo\Protractor Framework\customer-portal\npm-debug.log
C:\Users\jasharma\gitrepo\Protractor Framework\customer-portal>
Either:
Update the CI tool so it can run on a modern version of NodeJS
Use a tool like nvm to install multiple versions of NodeJS at the same time

using a pure-JavaScript implementation of bcrypt

Hi there I am using meteor js which is great but i am getting this message on my console .
W20161001-16:02:18.321(1)? (STDERR) Note: you are using a pure-JavaScript implementation of bcrypt.
W20161001-16:02:18.322(1)? (STDERR) While this implementation will work correctly, it is known to be
W20161001-16:02:18.322(1)? (STDERR) approximately three times slower than the native implementation.
W20161001-16:02:18.322(1)? (STDERR) In order to use the native implementation instead, run
W20161001-16:02:18.323(1)? (STDERR)
W20161001-16:02:18.323(1)? (STDERR) meteor npm install --save bcrypt
W20161001-16:02:18.323(1)? (STDERR)
W20161001-16:02:18.323(1)? (STDERR) in the root directory of your application.
I have node-gyp install globally, remove bcrypt from the packages file and running
meteor npm install --save bcrypt
to get this error
E:\Documents\Development\Projects\recipe-app\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Documents\Development\Projects\recipe-app\node_modules\bcrypt
gyp ERR! node -v v4.6.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt"
npm ERR! node v4.6.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! bcrypt#0.8.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.8.7 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\Documents\Development\Projects\recipe-app\npm-debug.log
Dont know what to do next really i am really new to meteor. I am on windows 10 using shell. node v4.6.0 Any help would be great.
You need to install an appropriate build environment to compile node addons (such as bcrypt). This means installing Python 2.7.x and some sort of toolchain.
You could try the windows-build-tools module which will try to install both Python and the minimum compiler environment via npm (or you can install the minimum compiler environment manually from here), otherwise for just the toolchain part there is always Visual C++ Express/Community (Desktop version).
Simply uninstall the package and reinstall it.
meteor npm uninstall bcrypt
meteor npm install bcrypt
If your bcrypt version is > 2.0.0 . You will never see this message again.

Gulp.js trouble installing, cannot find module 'fetch.js'?

I did an npm install and it generated a node_modules folder on my folder with only a gulp-livereload subfolder in it. My package.json has the following devDependencies:
.....
"devDependencies": {
"gulp": "^3.8.8",
"gulp-livereload": "^2.1.1"
}
}
When doing npm install/update, it is not generating the gulp folder and also giving me the error message:
> v8flags#1.0.1 install C:\Users\SLowe\node_modules\gulp\node_modules\v8flags
> node fetch.js
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\SYoung\fetch.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
npm ERR! v8flags#1.0.1 install: `node fetch.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the v8flags#1.0.1 install script.
npm ERR! This is most likely a problem with the v8flags package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node fetch.js
npm ERR! You can get their info via:
npm ERR! npm owner ls v8flags
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
"install" "--save-dev" "gulp"
npm ERR! cwd C:\Users\SYoung
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
Any help is appreciated. I am very new to nodejs.
It seems that the new gulp release (3.8.9) isn't compatible with v8flags. Try changing the package.json to
.....
"devDependencies": {
"gulp": "3.8.8",
"gulp-livereload": "^2.1.1"
}
}
If 3.8.8 doesn't work, 3.8.7 worked for me.
Yes, changing gulp to 3.8.8 helped me too.
I also installed gulp 3.8.8 and everything is now working fine.
npm install -g gulp#3.8.8
npm install gulp#3.8.8

Categories