我正在尝试学习MEAN堆栈,我已经在我的PC上使用npm安装了Node,Express和Angular,我还安装了Mongo DB,现在我正在尝试安装Mongoose,但我是无法安装!我在命令行中收到以下错误!请建议我安装它的方法
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>
答案 0 :(得分:1)
上述错误清楚地表明其中一个依赖模块kerberos@0.0.17
需要python作为安装的依赖项。但是在您的环境路径中找不到它。更好的是你应该安装python并在环境变量中设置路径。然后尝试在项目目录中安装mongoose。