无法安装Node Inspector

时间:2017-10-11 17:44:01

标签: node.js debugging

我尝试在两台不同的Windows 10计算机上安装,这两台计算机都具有管理员权限和节点v8.6.0。 + python 3.6.3 amd64。两者都失败了同样的错误:

C:\Users\kians>npm install -g node-inspector

> v8-profiler@5.7.0 preinstall C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-profiler
> node -e 'process.exit(0)'


> v8-debug@1.0.1 preinstall C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug
> node -e 'process.exit(0)'

C:\Users\kians\AppData\Roaming\npm\node-inspector -> C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\bin\inspector.js                                                                                                                                                                                                                                                            
C:\Users\kians\AppData\Roaming\npm\node-debug -> C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\bin\node-debug.js

> v8-debug@1.0.1 install C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://node-inspector.s3.amazonaws.com/debug/v1.0.1/node-v57-win32-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for v8-debug@1.0.1 and node@8.6.0 (node-v57 ABI) (falling back to source compile with node-gyp) 

C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug>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" clean )  else (node "" clean ) 

C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug>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" configure --fallback-to-build --module=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-w
in32-x64\debug.node --module_name=debug --module_path=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64 )  else (node "" configure --fallback-to-build --module=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64\debug.node --module_name=deb
ug --module_path=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64 ) 
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "C:\Users\kians\AppData\Local\Programs\Python\Python36\python.EXE", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\kians\\AppData\\Roaming\\npm\\node_modules\\node-inspector\\node_modules\\v8-debug\\build\\debug\\v1.0.1\\node-v57-win32-x64\\debug.node" "--module_name=debug" "--module_path=C:\\Users\
\kians\\AppData\\Roaming\\npm\\node_modules\\node-inspector\\node_modules\\v8-debug\\build\\debug\\v1.0.1\\node-v57-win32-x64"
gyp ERR! cwd C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64\debug.node --module_name=debug --module_path=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-w
in32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kians\\AppData\\Roaming\\npm\\node_modules\\node-inspector\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug
node-pre-gyp ERR! node -v v8.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok 
Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64\debug.node --module_name=debug --module_path=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64' (1)
npm ERR! code ELIFECYCLE                                                                                                                                                                                                                                                                                                                                                                        
npm ERR! errno 1
npm ERR! v8-debug@1.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the v8-debug@1.0.1 install 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\kians\AppData\Roaming\npm-cache\_logs\2017-10-11T17_39_49_176Z-debug.log

首先我认为来自aws的文件不可用但是在第一步中提取了很多文件,所以我认为下载失败不是问题。

我也可以打开:C:\ Users \ kians \ AppData \ Local \ Programs \ Python \ Python36 \ python.EXE

编辑:我运行以下命令:

npm install --global --production windows-build-tools

现在错误不同了:

C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug>if not defined npm_config_node_gyp (node "C:\Program File
s\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean )  else (node "" clean ) 

C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug>if not defined npm_config_node_gyp (node "C:\Program File
s\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\Users\kians
\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64\debug.node --module_name=debug --
module_path=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64 --pytho
n=C:\Users\kians\.windows-build-tools\python27\python.exe --msvs_version=2015 )  else (node "" configure --fallback-to-build --module=C:\Users
\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64\debug.node --module_name=de
bug --module_path=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64 -
-python=C:\Users\kians\.windows-build-tools\python27\python.exe --msvs_version=2015 ) 

C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug>if not defined npm_config_node_gyp (node "C:\Program File
s\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=C:\Users\kians\App
Data\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64\debug.node --module_name=debug --modu
le_path=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64 )  else (no
de "" build --fallback-to-build --module=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0
.1\node-v57-win32-x64\debug.node --module_name=debug --module_path=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules
\v8-debug\build\debug\v1.0.1\node-v57-win32-x64 ) 
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hi
nzufügen.
  debug.cc
  InjectedScriptHost.cc
  win_delay_load_hook.cc
..\src\debug.cc(41): warning C4996: 'v8::Debug::Call': was declared deprecated [C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspecto
r\node_modules\v8-debug\build\debug.vcxproj]
  C:\Users\kians\.node-gyp\8.6.0\include\node\v8-debug.h(195): note: see declaration of 'v8::Debug::Call'
..\src\debug.cc(52): warning C4996: 'v8::Debug::GetDebugContext': was declared deprecated [C:\Users\kians\AppData\Roaming\npm\node_modules\no
de-inspector\node_modules\v8-debug\build\debug.vcxproj]
  C:\Users\kians\.node-gyp\8.6.0\include\node\v8-debug.h(209): note: see declaration of 'v8::Debug::GetDebugContext'
..\src\debug.cc(57): warning C4996: 'v8::Debug::SendCommand': was declared deprecated [C:\Users\kians\AppData\Roaming\npm\node_modules\node-i
nspector\node_modules\v8-debug\build\debug.vcxproj]
  C:\Users\kians\.node-gyp\8.6.0\include\node\v8-debug.h(172): note: see declaration of 'v8::Debug::SendCommand'
..\src\debug.cc(78): error C2039: 'GetMirror': is not a member of 'v8::Debug' [C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector
\node_modules\v8-debug\build\debug.vcxproj]
  C:\Users\kians\.node-gyp\8.6.0\include\node\v8-debug.h(26): note: see declaration of 'v8::Debug'
..\src\debug.cc(78): error C3861: 'GetMirror': identifier not found [C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modu
les\v8-debug\build\debug.vcxproj]
..\src\debug.cc(71): warning C4996: 'v8::Debug::GetDebugContext': was declared deprecated [C:\Users\kians\AppData\Roaming\npm\node_modules\no
de-inspector\node_modules\v8-debug\build\debug.vcxproj]
  C:\Users\kians\.node-gyp\8.6.0\include\node\v8-debug.h(209): note: see declaration of 'v8::Debug::GetDebugContext'
..\src\debug.cc(80): warning C4996: 'v8::Debug::GetDebugContext': was declared deprecated [C:\Users\kians\AppData\Roaming\npm\node_modules\no
de-inspector\node_modules\v8-debug\build\debug.vcxproj]
  C:\Users\kians\.node-gyp\8.6.0\include\node\v8-debug.h(209): note: see declaration of 'v8::Debug::GetDebugContext'
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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js
" "build" "--fallback-to-build" "--module=C:\\Users\\kians\\AppData\\Roaming\\npm\\node_modules\\node-inspector\\node_modules\\v8-debug\\build
\\debug\\v1.0.1\\node-v57-win32-x64\\debug.node" "--module_name=debug" "--module_path=C:\\Users\\kians\\AppData\\Roaming\\npm\\node_modules\\n
ode-inspector\\node_modules\\v8-debug\\build\\debug\\v1.0.1\\node-v57-win32-x64"
gyp ERR! cwd C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\kians\AppData\Roaming\npm\node_modu
les\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64\debug.node --module_name=debug --module_path=C:\Users\kians\App
Data\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\node-pre-
gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kians\\AppData\\Roaming\\npm\\node_modules\\node-inspector\\node_m
odules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug
node-pre-gyp ERR! node -v v8.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok 
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules
\v8-debug\build\debug\v1.0.1\node-v57-win32-x64\debug.node --module_name=debug --module_path=C:\Users\kians\AppData\Roaming\npm\node_modules\n
ode-inspector\node_modules\v8-debug\build\debug\v1.0.1\node-v57-win32-x64' (1)
npm ERR! code ELIFECYCLE                                                                                                                      
npm ERR! errno 1
npm ERR! v8-debug@1.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the v8-debug@1.0.1 install 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\kians\AppData\Roaming\npm-cache\_logs\2017-10-11T18_45_47_242Z-debug.log

2 个答案:

答案 0 :(得分:1)

根据线程https://github.com/node-inspector/node-inspector/issues/1010#issuecomment-306972510,节点检查器不使用节点8.X。

您可以使用内置调试工具。 https://nodejs.org/en/docs/inspector/

答案 1 :(得分:0)

首先,此错误似乎与node-gyp包有关。根据他们在github中的文档page,Windows有2个设置选项。

选项1是运行:

npm install --global --production windows-build-tool

你已经完成了,但根据我的经验,这对我也没有用。

尝试选项2:

  1. 使用“默认安装”选项安装Visual C ++生成工具。
  2. 安装Visual Studio 2015(或修改现有安装)并在安装过程中选择Visual C ++常用工具。这也适用于免费的社区和Express for Desktop版本。
  3. 安装Python 2.7(不支持v3.x.x),并运行npm config set python python2.7(或参阅下面有关指定正确的Python版本和路径的进一步说明。)
  4. 启动cmd,npm config set msvs_version 2015