我正在尝试运行此nodetime,但是似乎存在一些我无法弄清楚的问题。我按照向导的指示做,所以我应该遵循以下步骤:


  启动应用程序后,将在控制台中打印https://nodetime.com/[session_id]形式的链接,该会话将是您访问探查器服务器的唯一ID。


最终,控制台不显示任何会话ID链接,仅显示以下内容:

23 Aug 13:32:23 - Nodetime: profiler resumed for 180 seconds

也许你们中有人遇到过同样的问题?寻找修复!提前致谢!

以下是我在安装nodetime之后得到的结果,我遇到了一些Python错误,但似乎仍然可以成功安装...

npm WARN package.json [email protected] No README.md file found!
npm WARN package.json [email protected] No README.md file found!
npm http GET http://registry.npmjs.org/nodetime
npm http 200 http://registry.npmjs.org/nodetime
npm http GET http://registry.npmjs.org/nodetime/-/nodetime-0.4.5.tgz
npm http 200 http://registry.npmjs.org/nodetime/-/nodetime-0.4.5.tgz
npm http GET http://registry.npmjs.org/request/2.10.0
npm http GET http://registry.npmjs.org/v8tools
npm http GET http://registry.npmjs.org/timekit
npm http 200 http://registry.npmjs.org/request/2.10.0
npm http GET http://registry.npmjs.org/request/-/request-2.10.0.tgz
npm http 200 http://registry.npmjs.org/v8tools
npm http GET http://registry.npmjs.org/v8tools/-/v8tools-0.1.1.tgz
npm http 200 http://registry.npmjs.org/timekit
npm http GET http://registry.npmjs.org/timekit/-/timekit-0.1.9.tgz
npm http 200 http://registry.npmjs.org/v8tools/-/v8tools-0.1.1.tgz
npm http 200 http://registry.npmjs.org/request/-/request-2.10.0.tgz
npm http 200 http://registry.npmjs.org/timekit/-/timekit-0.1.9.tgz
npm http GET http://registry.npmjs.org/bindings
npm http 200 http://registry.npmjs.org/bindings

> [email protected] install C:\Users\TJIA\Desktop\Sommarjobb\Extrauppgifter\demo\nod
e_modules\nodetime\node_modules\timekit
> node-gyp rebuild


> [email protected] install C:\Users\TJIA\Desktop\Sommarjobb\Extrauppgifter\demo\nod
e_modules\nodetime\node_modules\v8tools
> node-gyp rebuild


C:\Users\TJIA\Desktop\Sommarjobb\Extrauppgifter\demo\node_modules\nodetime\node_
modules\timekit>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gy
p-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild

C:\Users\TJIA\Desktop\Sommarjobb\Extrauppgifter\demo\node_modules\nodetime\node_
modules\v8tools>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gy
p-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
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 (x86)\nodejs\node_modules\n
pm\node_modules\node-gyp\lib\configure.js:110:14)
gyp ERR! stack     at C:\Program Files (x86)\nodejs\node_modules\npm\node_module
s\node-gyp\lib\configure.js:74:11
gyp ERR! stack     at Object.oncomplete (fs.js:297:15)
gyp gypERR!  System Windows_NT 6.1.7601
ERR! gyp configure errorERR!
 command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_module
s\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\TJIA\Desktop\Sommarjobb\Extrauppgifter\demo\node_modules\n
odetime\node_modules\timekit
gypgyp  ERR! node -v v0.8.5
gyp ERR! node-gyp -v v0.6.3
gyp ERR! not ok
ERR! stack Error: Can't find Python executable "python", you can set the PYTHON
env variable.
gyp ERR! stack     at failNoPython (C:\Program Files (x86)\nodejs\node_modules\n
pm\node_modules\node-gyp\lib\configure.js:110:14)
gyp ERR! stack     at C:\Program Files (x86)\nodejs\node_modules\npm\node_module
s\node-gyp\lib\configure.js:74:11
gyp ERR! stack     at Object.oncomplete (fs.js:297:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\nod
e_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\TJIA\Desktop\Sommarjobb\Extrauppgifter\demo\node_modules\n
odetime\node_modules\v8tools
gyp ERR! node -v v0.8.5
gyp ERR! node-gyp -v v0.6.3
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
npm WARN optional dep failed, continuing [email protected]
[email protected] node_modules\nodetime
+-- [email protected]

最佳答案

npm无法安装nodetime的可选依赖项:timekit和v8tools(C绑定),并且在前面的答案中正确提到了原因(python缺失)。尽管即使没有这些模块也应该可以使用(尽管有些功能将无法使用,例如CPU和堆分析)。

如果您的初始化看起来像这样的require('nodetime').profile(),即没有任何参数的profile()调用,那么除了失败的可选依赖项之外还有其他问题。使用调试标志查看问题所在:require('nodetime').profile({debug: true})。可能与网络相关,等等。

如果您使用的是Nodetime Pro,并且在配置文件调用中包含了帐户密钥和应用名称,即require('nodetime').profile({accountKey: '...', appName: '...'}),则您的应用应在登录到nodetime.com后显示在您的应用页面上。在这种情况下,没有会话链接被打印到控制台。

关于javascript - 无法使Nodetime正常运行,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12091009/

10-12 06:59