每当我尝试为nodejs安装mongoose模块时,我都会得到与下面所示相同的错误。我尝试卸载并重新安装。它提到了一些关于python的东西,但我相信我已经在这台计算机上安装了python。我该怎么办?
npm http 304 https://registry.npmjs.org/kareem
npm http 304 https://registry.npmjs.org/mpromise
npm http 304 https://registry.npmjs.org/mquery
npm http 304 https://registry.npmjs.org/ms
npm http 304 https://registry.npmjs.org/sliced
npm http 304 https://registry.npmjs.org/regexp-clone
npm http 304 https://registry.npmjs.org/muri
npm http 304 https://registry.npmjs.org/hooks-fixed
npm http 304 https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/bluebird
npm http GET https://registry.npmjs.org/bson-ext
npm http GET https://registry.npmjs.org/mongodb-core
npm http GET https://registry.npmjs.org/readable-stream
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/bluebird
npm http 304 https://registry.npmjs.org/readable-stream
npm http 304 https://registry.npmjs.org/mongodb-core
npm http 304 https://registry.npmjs.org/bson-ext
npm http GET https://registry.npmjs.org/core-util-is
npm http GET https://registry.npmjs.org/isarray
npm http GET https://registry.npmjs.org/string_decoder
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/nan
npm http GET https://github.com/mongodb-js/node-pre-gyp/archive/v0.6.5-appveyor.
tar.gz
npm http 304 https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/isarray
npm http 304 https://registry.npmjs.org/core-util-is
npm http 304 https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/kerberos
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/kerberos
> kerberos@0.0.12 install C:\javascript\node_modules\mongoose\node_modules\mongo
db\node_modules\mongodb-core\node_modules\kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
C:\javascript\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-co
re\node_modules\kerberos>node "C:\Program Files\nodejs\node_modules\npm\bin\node
-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
npm http 200 https://github.com/mongodb-js/node-pre-gyp/archive/v0.6.5-appveyor.
tar.gz
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/rc
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/npmlog
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/tar-pack
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/rc
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/tar
npm http 304 https://registry.npmjs.org/tar-pack
npm http 304 https://registry.npmjs.org/npmlog
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/ansi
npm http GET https://registry.npmjs.org/are-we-there-yet
npm http GET https://registry.npmjs.org/gauge
npm http GET https://registry.npmjs.org/uid-number
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/once
npm http GET https://registry.npmjs.org/minimist
npm http GET https://registry.npmjs.org/deep-extend
npm http GET https://registry.npmjs.org/strip-json-comments
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/ini
npm http GET https://registry.npmjs.org/fstream-ignore
npm http GET https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/once
npm http 304 https://registry.npmjs.org/are-we-there-yet
npm http 304 https://registry.npmjs.org/gauge
npm http 304 https://registry.npmjs.org/minimist
npm http 304 https://registry.npmjs.org/deep-extend
npm http 304 https://registry.npmjs.org/uid-number
npm http 304 https://registry.npmjs.org/strip-json-comments
npm http 304 https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/ini
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/fstream-ignore
npm http 304 https://registry.npmjs.org/ansi
npm http GET https://registry.npmjs.org/delegates
npm http GET https://registry.npmjs.org/inflight
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/has-unicode
npm http GET https://registry.npmjs.org/lodash.pad
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/lodash.padleft
npm http GET https://registry.npmjs.org/lodash.padright
npm http 304 https://registry.npmjs.org/delegates
npm http 304 https://registry.npmjs.org/inflight
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/lodash.padleft
npm http 304 https://registry.npmjs.org/lodash.padright
npm http GET https://registry.npmjs.org/bl
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/mime-types
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/caseless
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/aws-sign2
npm http GET https://registry.npmjs.org/isstream
npm http GET https://registry.npmjs.org/stringstream
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/har-validator
npm http 304 https://registry.npmjs.org/has-unicode
npm http 304 https://registry.npmjs.org/lodash.pad
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/mime-types
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/tough-cookie
npm http 304 https://registry.npmjs.org/bl
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/caseless
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/http-signature
npm http 304 https://registry.npmjs.org/hawk
npm http 304 https://registry.npmjs.org/aws-sign2
npm http 304 https://registry.npmjs.org/isstream
npm http 304 https://registry.npmjs.org/stringstream
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/har-validator
npm http GET https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/block-stream
npm http GET https://registry.npmjs.org/wrappy
npm http GET https://registry.npmjs.org/lodash._basetostring
npm http GET https://registry.npmjs.org/lodash._createpadding
npm http 304 https://registry.npmjs.org/wrappy
npm http 304 https://registry.npmjs.org/lodash._createpadding
npm http 304 https://registry.npmjs.org/lodash._basetostring
npm http GET https://registry.npmjs.org/delayed-stream
npm http GET https://registry.npmjs.org/mime-db
npm http 304 https://registry.npmjs.org/delayed-stream
npm http 304 https://registry.npmjs.org/mime-db
npm http GET https://registry.npmjs.org/brace-expansion
npm http GET https://registry.npmjs.org/lodash.repeat
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/brace-expansion
npm http GET https://registry.npmjs.org/asn1
npm http GET https://registry.npmjs.org/assert-plus
npm http GET https://registry.npmjs.org/ctype
npm http 304 https://registry.npmjs.org/lodash.repeat
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/ctype
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/asn1
npm http 304 https://registry.npmjs.org/assert-plus
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/is-my-json-valid
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/is-my-json-valid
npm http GET https://registry.npmjs.org/has-ansi
npm http GET https://registry.npmjs.org/escape-string-regexp
npm http GET https://registry.npmjs.org/strip-ansi
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/supports-color
npm http 304 https://registry.npmjs.org/supports-color
npm http 304 https://registry.npmjs.org/has-ansi
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/strip-ansi
npm http 304 https://registry.npmjs.org/escape-string-regexp
npm http GET https://registry.npmjs.org/balanced-match
npm http GET https://registry.npmjs.org/concat-map
npm http GET https://registry.npmjs.org/graceful-readlink
npm http 304 https://registry.npmjs.org/balanced-match
npm http 304 https://registry.npmjs.org/concat-map
npm http 304 https://registry.npmjs.org/graceful-readlink
npm http GET https://registry.npmjs.org/ansi-regex
npm http GET https://registry.npmjs.org/ansi-regex
npm http GET https://registry.npmjs.org/get-stdin
npm http 304 https://registry.npmjs.org/ansi-regex
npm http 304 https://registry.npmjs.org/get-stdin
npm http 304 https://registry.npmjs.org/ansi-regex
npm http GET https://registry.npmjs.org/generate-function
npm http GET https://registry.npmjs.org/generate-object-property
npm http GET https://registry.npmjs.org/jsonpointer
npm http GET https://registry.npmjs.org/xtend
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/generate-function
npm http 304 https://registry.npmjs.org/generate-object-property
npm http 304 https://registry.npmjs.org/jsonpointer
npm http 304 https://registry.npmjs.org/xtend
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/is-property
npm http 304 https://registry.npmjs.org/is-property
> bson-ext@0.1.8 install C:\javascript\node_modules\mongoose\node_modules\bson\n
ode_modules\bson-ext
> (node-pre-gyp install --fallback-to-build) || (node-gyp rebuild 2> builderror.
log) || (exit 0)
node-pre-gyp http GET https://bin.mongodb.org/js/bson-ext/v0.1.8/bson-v0.1.8-nod
e-v11-win32-x64.tar.gz
node-pre-gyp http CERT_UNTRUSTED (falling back to source compile with node-gyp)
C:\javascript\node_modules\mongoose\node_modules\bson\node_modules\bson-ext>node
"C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\
node-gyp\bin\node-gyp.js" clean
C:\javascript\node_modules\mongoose\node_modules\bson\node_modules\bson-ext>node
"C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\
node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\javascript\n
ode_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release\bson.
node --module_name=bson --module_path=C:\javascript\node_modules\mongoose\node_m
odules\bson\node_modules\bson-ext\build\Release
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:103:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:64:11
gyp ERR! stack at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\
\javascript\\node_modules\\mongoose\\node_modules\\bson\\node_modules\\bson-ext\
\build\\Release\\bson.node" "--module_name=bson" "--module_path=C:\\javascript\\
node_modules\\mongoose\\node_modules\\bson\\node_modules\\bson-ext\\build\\Relea
se"
gyp ERR! cwd C:\javascript\node_modules\mongoose\node_modules\bson\node_modules\
bson-ext
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallb
ack-to-build --module=C:\javascript\node_modules\mongoose\node_modules\bson\node
_modules\bson-ext\build\Release\bson.node --module_name=bson --module_path=C:\ja
vascript\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Rel
ease' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\javascript\node_modu
les\mongoose\node_modules\bson\node_modules\bson-ext\node_modules\node-pre-gyp\l
ib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:753:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_proces
s.js:820:5)
node-pre-gyp ERR! System Windows_NT 6.2.9200
node-pre-gyp ERR! command "node" "C:\\javascript\\node_modules\\mongoose\\node_m
odules\\bson\\node_modules\\bson-ext\\node_modules\\node-pre-gyp\\bin\\node-pre-
gyp.js" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\javascript\node_modules\mongoose\node_modules\bson\node
_modules\bson-ext
node-pre-gyp ERR! node -v v0.10.28
node-pre-gyp ERR! node-pre-gyp -v v0.6.4
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\javasc
ript\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release
\bson.node --module_name=bson --module_path=C:\javascript\node_modules\mongoose\
node_modules\bson\node_modules\bson-ext\build\Release' (1)
C:\javascript\node_modules\mongoose\node_modules\bson\node_modules\bson-ext>node
"C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\
node-gyp\bin\node-gyp.js" rebuild
mongoose@4.0.5 node_modules\mongoose
├── regexp-clone@0.0.1
├── sliced@0.0.5
├── muri@1.0.0
├── hooks-fixed@1.0.1
├── mpromise@0.5.4
├── kareem@1.0.1
├── mpath@0.1.1
├── async@0.9.0
├── ms@0.1.0
├── mquery@1.5.1 (debug@0.7.4, bluebird@2.9.9)
├── mongodb@2.0.33 (readable-stream@1.0.31, mongodb-core@1.1.32)
└── bson@0.3.2 (bson-ext@0.1.8)
C:\javascript>
答案 0 :(得分:-1)
npm@1.4.21 C:\Program Files\nodejs\node_modules\npm
C:\Users\venkmada\Desktop\MyApp\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos>npm install mongodb --save
mongodb@2.0.42 node_modules\mongodb
├── es6-promise@2.1.1
├── readable-stream@1.0.31 (inherits@2.0.1, isarray@0.0.1, string_decoder@0.10.31, core-util-is@1.0.1)
└── mongodb-core@1.2.10 (bson@0.4.11)
C:\Users\venkmada\Desktop\MyApp\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos>npm install mongoose -save
mongoose@4.1.3 node_modules\mongoose
├── regexp-clone@0.0.1
├── sliced@0.0.5
├── muri@1.0.0
├── mpromise@0.5.4
├── hooks-fixed@1.1.0
├── kareem@1.0.1
├── mpath@0.1.1
├── async@0.9.0
├── ms@0.1.0
├── bson@0.4.11
├── mquery@1.6.1 (debug@2.2.0, bluebird@2.9.26)
└── mongodb@2.0.40 (mongodb-core@1.2.9, es6-promise@2.1.1, readable-stream@1.0.31)
C:\Users\venkmada\Desktop\MyApp\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos>
.................试试这个对我有用.............