Mongoose not being able to install from CMD - cmd

I am trying to learn MEAN stack, i've installed Node,Express,and Angular on my PC using npm, i've also installed Mongo DB and now i am trying to install Mongoose, but i am not able to install it ! i am getting the following error in the command line ! please suggest me a way to install it
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\nishanth>npm install mongoose
npm WARN peerDependencies The peer dependency kerberos#~0.0 included from mongod
b-core will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerD
ependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it
explicitly.
> kerberos#0.0.17 install C:\Users\nishanth\node_modules\mongoose\node_modules\m
ongodb\node_modules\kerberos
> (node-gyp rebuild) || (exit 0)
\
C:\Users\nishanth\node_modules\mongoose\node_modules\mongodb\node_modules\kerber
os>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_module
s\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 "C:\Python33", you can set th
e PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\nishanth\node_modules\mongoose\node_modules\mongodb\node_m
odules\kerberos
gyp ERR! node -v v4.2.1
v3.0.3! node-gyp -v-
gyp ERR! not ok
mongoose#4.3.5 node_modules\mongoose
├── ms#0.7.1
├── hooks-fixed#1.1.0
├── async#0.9.0
├── regexp-clone#0.0.1
├── mpromise#0.5.4
├── mpath#0.1.1
├── muri#1.0.0
├── sliced#0.0.5
├── kareem#1.0.1
├── bson#0.4.19
├── mquery#1.6.3 (debug#2.2.0, bluebird#2.9.26)
└── mongodb#2.1.2 (es6-promise#3.0.2, kerberos#0.0.17, mongodb-core#1.2.30, read
able-stream#1.0.31)
C:\Users\nishanth>

The above error clearly indicate that one of the dependency module kerberos#0.0.17 require python as dependency for installation. But it not found in your environment path. Better you should install python and set the path in environment variable. Then try to install the mongoose inside your project directory.

Related

Yeoman generator not getting installed in VDI

Trying to install(with Admin privileges) the Yeoman using "npm install -g yo generator-office" in VDI for Office Word Add-in
All the proxies and registry are set properly for the VDI, still facing the issue with below error.
npm install -g yo generator-office
npm WARN deprecated opn#6.0.0: The package has been renamed to open
npm WARN deprecated request#2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
C:\Users\Administrator\AppData\Roaming\npm\yo-complete -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\yo\lib\completion\index.js
C:\Users\Administrator\AppData\Roaming\npm\yo -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\yo\lib\cli.js
yo#3.1.1 postinstall C:\Users\Administrator\AppData\Roaming\npm\node_modules\yo
yodoctor
Yeoman Doctor
Running sanity checks on your system
√ No .bowerrc file in home directory
√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ No .yo-rc.json file in home directory
√ Node.js version
ErrorClass [RequestError]: getaddrinfo ENOTFOUND registry.npmjs.org
at ClientRequest. (C:\Users\Administrator\AppData\Roaming\npm\node_modules\yo\node_modules\latest-version\node_modules\got\index.js:73:21)
at Object.onceWrapper (events.js:313:26)
at ClientRequest.emit (events.js:223:5)
at ClientRequest.EventEmitter.emit (domain.js:475:20)
at Socket.socketErrorListener (_http_client.js:406:9)
at Socket.emit (events.js:223:5)
at Socket.EventEmitter.emit (domain.js:475:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:81:21) {
code: 'ENOTFOUND',
message: 'getaddrinfo ENOTFOUND registry.npmjs.org',
host: 'registry.npmjs.org'
hostname: 'registry.npmjs.org',
method: 'GET',
path: '/yo'
}
× yo version
ErrorClass [RequestError]: getaddrinfo ENOTFOUND registry.npmjs.org
at ClientRequest.
(C:\Users\Administrator\AppData\Roaming\npm\node_modules\yo\node_modules\latest-version\node_modules\got\index.js:73:21)
at Object.onceWrapper (events.js:313:26)
at ClientRequest.emit (events.js:223:5)
at ClientRequest.EventEmitter.emit (domain.js:475:20)
at Socket.socketErrorListener (_http_client.js:406:9)
at Socket.emit (events.js:223:5)
at Socket.EventEmitter.emit (domain.js:475:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:81:21) {
code: 'ENOTFOUND',
message: 'getaddrinfo ENOTFOUND registry.npmjs.org',
host: 'registry.npmjs.org',
hostname: 'registry.npmjs.org',
method: 'GET',
path: '/yo'
}
Found potential issues on your machine
generator-office#1.7.6
yo#3.1.1
updated 2 packages in 194.549s

Strapi Graphql Plugin Crashes Strapi Server

I just tried to install the graphql plugin for strapi (i.e., strapi-plugin-graphql). When I tried to install it via the admin interface, I got the following error message:
The restart takes longer than expected
The server should have restarted, please check your logs in the terminal
When I check my terminal, this is what I see:
[2019-12-27T07:47:12.612Z] debug GET /admin/plugins (5 ms) 200
[2019-12-27T07:47:15.882Z] info Installing graphql...
[2019-12-27T07:48:59.105Z] info File changed: C:\code\tutorials\react\Gatsby\strapi\startup-reporter\package.json[2019-12-27T07:48:59.279Z] debug POST /admin/plugins/install (103411 ms) 200
[2019-12-27T07:48:59.281Z] info The server is restarting
[2019-12-27T07:49:14.672Z] debug ⛔️ Server wasn't able to start properly.
[2019-12-27T07:49:14.674Z] error Error: Field "Query.news" can only be defined once.
at assertValidSDL (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql\validation\validate.js:108:11)
at Object.buildASTSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql\utilities\buildASTSchema.js:71:34)
at Object.buildSchemaFromTypeDefinitions (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql-tools\dist\generate\buildSchemaFromTypeDefinitions.js:23:28)
at makeExecutableSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql-tools\dist\makeExecutableSchema.js:26:29)
at Object.generateSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi-plugin-graphql\services\Schema.js:300:22)
at Object.initialize (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi-plugin-graphql\hooks\graphql\index.js:59:50)
at Promise.resolve.then (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi\lib\hooks\index.js:37:28)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! startup-reporter#0.1.0 dev: `strapi develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the startup-reporter#0.1.0 dev 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\moshe\AppData\Roaming\npm-cache\_logs\2019-12-27T07_49_14_697Z-debug.log
Any idea why I am getting this error message and how to fix it?
UPDATE:
I should note that I did a fresh install of strapi and then installed the graphql plugin -- and it installed properly. It only didn't work with an installation that already had custom post types. I don't know why that is -- and what I can do to install it with those custom post types. Any ideas?
Here is the issue about this problem
https://github.com/strapi/strapi/issues/1198
Some words are not well managed for the pluralize version.
So the issue is due to that point.
There is currently nothing to do to fix it by your own.

Installation LoopBack-CLI error node-gyp rebuild

Hi Im installing the loopback-cli.
Running these commands:
npm install --global --production windows-build-tools
AND
npm install -g loopback-cli
The second command run rebuilding the ursa module into error. There is some link to C:\OpenSSL-Win64. What the ... is this? Some hardcoded library link?
Write me please some way how to install normally the loopback. This is from their installation site. Thanx.
Here the log:
C:\Users\Erik\AppData\Roaming\npm\node_modules\loopback-cli\node_modules\ursa>if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
ursaNative.cc
win_delay_load_hook.cc
..\src\ursaNative.cc(157): warning C4244: 'argument': conversion from 'ssize_t' to 'int', possible loss of data [C:\Use
rs\Erik\AppData\Roaming\npm\node_modules\loopback-cli\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(172): warning C4244: 'argument': conversion from 'ssize_t' to 'int', possible loss of data [C:\Use
rs\Erik\AppData\Roaming\npm\node_modules\loopback-cli\node_modules\ursa\build\ursaNative.vcxproj]
LINK : fatal error LNK1181: cannot open input file 'C:\OpenSSL-Win64\lib\libeay32.lib' [C:\Users\Erik\AppData\Roaming\n
pm\node_modules\loopback-cli\node_modules\ursa\build\ursaNative.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Erik\AppData\Roaming\npm\node_modules\loopback-cli\node_modules\ursa
gyp ERR! node -v v8.9.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa#0.9.4 (node_modules\loopback-cli\node_modules\ursa):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa#0.9.4 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ loopback-cli#4.0.0
added 3 packages and updated 1 package in 27.638s
Same issue here.
Setup before fixing:
lb -v 4.2.1 (generator-loopback#5.9.4 loopback-workspace#4.5.0)
node -v v10.13.0
OS: Windows 10 Home
I was able to fix the issue after taking the following steps:
Install node v8.12.0
Install OpenSSL 1.1 in C:\OpenSSL-Win64 (strong-ursa hard codes the location)
Create a symbolic link in C:\OpenSSL-Win64\lib named libeay64.lib which targets libcrypto.lib.
Run npm i -g windows-build-tools
Run npm i -g looback-cli again.
I'm not sure if rolling back the NodeJS version to 8.12 is necessary. There are a few widely, albeit not well documented pain points working with Loopback due to strong-ursa's use of native libraries. (Please note, this is unconfirmed information as I'm in a hurry to get back to developing the project at hand.) These steps allowed me to continue using Loopback CLI unhindered.
Useful links:
Download previous NodeJS releases: https://nodejs.org/en/download/releases/
Download OpenSSL: https://slproweb.com/products/Win32OpenSSL.html
windows-build-tools: https://github.com/felixrieseberg/windows-build-tools
https://github.com/curl/curl/issues/984
https://github.com/strongloop/loopback-cli/issues/36#issuecomment-434331508

Now is not recognized as an internal or external command - when attempting to host a page with Zeit

"scripts": {
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build": "npm run build-css && react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --
watch --recursive",
"now-start": "node server/server.js",
"deploy": "now --public --dotenv=.env.prod -d"
},
"now": {
"alias": "lendahand"
}
}
Greetings. I'm trying to host a project with Zeit but I am getting an error I don't know how to fix. The error is saying that now is not an internal or external command, but it appears to be showing up in my package.json. I don't know how to remedy this situation. Do you have any suggestions?
The error is:
persona-project2-front#0.1.0 deploy C:\Users\Kim\DevMountain\LendAHandPP
> now --public --dotenv=.env.prod -d
'now' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! persona-project2-front#0.1.0 deploy: `now --public --
dotenv=.env.prod -d`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the persona-project2-front#0.1.0 deploy 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\Kim\AppData\Roaming\npm-cache\_logs\2017-11-
06T23_38_07_616Z-debug.log
Add the directory that now exists in to your PATH/path environmental variable, then you can use now. Make sure to close and re-open your terminal for the env. var. to take effect.
If that's not working, first make sure to install now like this:
npm install now -g to install it globally in your global npm/node_modules directory.
Then test it.
Thirdly, if that is not working, it could be a problem with the environmental variable not being set, so you may need to get root/administrator access and set that in the PATH env var for your system. As for the terminal, maybe try opening your terminal with admin access, or if on linux try something like sudo now.
Finally, after doing your npm install now -g it should display some messages like
'... -> C:\Users\\AppData\Roaming\npm\node_modules\now\download\dist\now ...'
Use that directory to work with now. This would open now process inside your terminal, your directory to now may be different, make sure to set this directory in your PATH if possible.

"npm faq" fails on Windows 7 ("spawn ENOENT" errors)

I have installed node.js on Windows 7 with their latest installer. It seemed to work, I can call npm and node from the console (either cmd or PowerShell), but I keep getting errors.
There are a lot of questions here about node.js on windows, but they all mention some specific piece of code. I'm getting the "spawn ENOENT" with a lot of simple commands, for instance yo, if I then pick "update generators" :
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34)
even npm faq fails :
PS E:\www\something> npm faq
npm ERR! Error: spawn ENOENT
npm ERR! at errnoException (child_process.js:988:11)
npm ERR! at Process.ChildProcess._handle.onexit (child_process.js:779:34)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/isaacs/npm/issues>
It seems that the problem is that node uses unix command names like dir, which do not exist on Windows. Some blog posts mention using Cygwin, but mostly for building node.js, not for calling it. The official nodejs website doesn't mention that cygwin is a prerequisite, either.
Here's the npm-debug.log :
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'faq' ]
2 info using npm#1.3.24
3 info using node#v0.10.25
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 error Error: spawn ENOENT
5 error at errnoException (child_process.js:988:11)
5 error at Process.ChildProcess._handle.onexit (child_process.js:779:34)
6 error If you need help, you may report this *entire* log,
6 error including the npm and node versions, at:
6 error <http://github.com/isaacs/npm/issues>
7 error System Windows_NT 6.1.7601
8 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "faq"
9 error cwd E:\
10 error node -v v0.10.25
11 error npm -v 1.3.24
12 error syscall spawn
13 error code ENOENT
14 error errno ENOENT
15 verbose exit [ 1, true ]
Make sure that you have c:\Windows\System32 on your 'Path' System Variable. I was having this exact problem and this was the fix I needed. I must have taken it out in error sometime in the past.

Resources