Installing v8-profiler using npm - node.js

While trying
npm install -g v8-profiler
I'm hitting the below errors:
..\graph_node.cc(99): error C2039: 'GetRetainersCount' : is not a member of 'v8::HeapGraphNode' [C:\Users\username\AppData\Roaming\npm\node_modules\v8
-profiler\build\profiler.vcxproj]
C:\Users\username\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(249) : see declaration of 'v8::HeapGraphNode'
..\graph_node.cc(132): error C2039: 'GetRetainedSize' : is not a member of 'v8::HeapGraphNode' [C:\Users\username\AppData\Roaming\npm\node_modules\v8-
profiler\build\profiler.vcxproj]
C:\Users\username\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(249) : see declaration of 'v8::HeapGraphNode'
..\graph_node.cc(154): error C2039: 'GetRetainer' : is not a member of 'v8::HeapGraphNode' [C:\Users\username\AppData\Roaming\npm\node_modules\v8-prof
iler\build\profiler.vcxproj]
C:\Users\username\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(249) : see declaration of 'v8::HeapGraphNode'
..\graph_node.cc(162): error C2039: 'GetDominatorNode' : is not a member of 'v8::HeapGraphNode' [C:\Users\username\AppData\Roaming\npm\node_modules\v8
-profiler\build\profiler.vcxproj]
C:\Users\username\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(249) : see declaration of 'v8::HeapGraphNode'
profiler.cc
Looks like a compilation issue. What might be wrong ?
My system has :
Visual Studio 2010
Windows SDK 7.1 Note: If you get error on installation, maybe this
link will help you.
Visual Studio 2010 SP1
Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1
Python 2.7
As mentioned in : https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup

I just ran into this same issue. It looks like NodeFly's fork of v8-profiler contains the fix that Sean described, so I installed that version instead:
npm install nodefly-v8-profiler

According to this comment on GitHub, some APIs were removed from V8, and v8-profiler hasn't been updated.
It was V8 problem.
v8-profiler uses some V8 API's, but those API's are eliminated from V8 in version 3.11.5.
...
In order to use v8-profiler, simplest way is to remove the following
methods and SetAccessor call inside constructor from graph_node.cc and
rebuild v8-profiler.
GraphNode::GetRetainersCount
GraphNode::GetRetainedSize
GraphNode::GetRetainer
GraphNode::GetDominator
But of course, if you do this, you can't see anymore dominator and retainer informations.

Related

Visual C++ 2017 link error due to -Ot flag?

I am trying to get a Visual Studio 2017 project to link, but I'm stuck on the following linker error:
LINK : fatal error C1007: unrecognized flag '-Ot' in 'p2'
I've read questions on what the cause could be, but I couldn't come to a solution for my project.
The details are that, due to an external component we have no control over (component A), this Visual Studio 2017 project is forced to use the v14.13 version of the C++ toolchain, i.e. not the latest one (v14.14). However, the latest release of another external precompiled static lib we have no control over either (component B), is built with the v14.14 version (I checked via a dumpbin extract of the debug version of the lib). Switching my project over to the v14.14 toolchain indeed makes the link error go away on component B, but this unfortunately isn't a solution for me due to component A. Taking an earlier version of component B isn't desirable either, since we need the functionality in the latest release...
However, what strikes me, is that the /Ot ("optimize for speed") flag has been around since the middle ages... Why wouldn't v14.13 recognize it? Or is it just an (awkwardly manifested) matter of a mismatched obj file layout due to the version differences? And, probably related, what does the 'p2' stand for anyway?
Update
I've checked the linker output by using the /verbose flag, and all seems normal (3600 lines of Searching <lib>, Found <function>, Referenced in <obj> and Loaded <lib>).
Right up until the end that is, where I get the following 6 lines:
1> Searching C:\PathToExternalLib\TheirStatic.lib:
1> Found UsedFunctionName
1> Referenced in MyOwnStatic.lib(MyOwnCompileUnit.obj)
1>LINK : fatal error C1007: unrecognized flag '-Ot' in 'p2'
1>LINK : fatal error LNK1257: code generation failed
1>Done building project "MyProject.vcxproj" -- FAILED.
And that's that.
When visiting the command line setting of the link properties of the project, the only thing listed is (broken up in separate lines for convenience):
/OUT:"MyProject.dll"
/MANIFEST
/NXCOMPAT
/PDB:"MyProject.pdb"
/DYNAMICBASE "C:\PathToMyStatic.lib"
/IMPLIB:"MyProject.lib"
/DLL
/MACHINE:X64
/PGD:"MyProject.pgd"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/ManifestFile:"MyProject.prm.intermediate.manifest"
/ERRORREPORT:PROMPT
/NOLOGO
/LIBPATH:"C:\PathToExternalStaticLib"
/LIBPATH:"C:\PathToAnotherExternalStaticLib"
/TLBID:1
So no trace of any -Ot flag there as well...?
I had this problem. LINK : fatal error C1007: unrecognized flag '-Ot' in 'p2'
while building a project with Visual Studio 2015.
I had to rebuild any library or sub library the project linked to which were built with Visual Studio 2017.
Once I rebuild the dependent libraries with Visual Studio 2015 the first project was able to link against them.
project
--------\
---------lib1(unable to rebuild lib1 until its dependencies were also rebuilt with VS2015
--------------\lib_linked_by_lib1_which_was_build_with_VS2017_and_had_to_be_rebuilt
--------------\another_lib_which_had_to_be_rebuilt_for_lib1_with_VS2015
--------\lib2
--------\lib3

Building node contextify using Visual Studio 2013

I'm attempting to get "contextify" to build on my machine. It is a Windows 10 machine.
I am using Windows 10
I have Visual Studio 2013 Professional installed.
I have python 2.7.10, and it's in my PATH.
I have node 4.1.2 32 bit installed (I had previously tried with 64 bit, which is the default that the node website wanted me to download, but it appears to make no difference).
I've got no idea what the right sequence of steps should be, I don't know anything about node-gyp, npm etc, I'm just trying to build a project that has a dependency on contextify.
I've done a clone of the contextify repo from git hub and naively run
`npm install'. I'm using a Visual Studio command prompt (either VS2013 x64 Native Tools Command Prompt or VS2013 x86 Native Tools Command Prompt, makes no difference).
What I get is this:
d:\work\contextify>npm install
> contextify#0.1.14 install d:\work\contextify
> node-gyp rebuild
d:\work\contextify>if not defined npm_config_node_gyp (node "C:\Users\tomq\AppData\Roaming\npm\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.
contextify.cc
d:\work\contextify\node_modules\nan\nan.h(263): error C2995: 'v8::Local<T> _NanEnsureLocal(v8::Local<T>)' : function te
mplate has already been defined [d:\work\contextify\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(256) : see declaration of '_NanEnsureLocal'
d:\work\contextify\node_modules\nan\nan.h(661): error C3083: 'smalloc': the symbol to the left of a '::' must be a type
[d:\work\contextify\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(661): error C2039: 'FreeCallback' : is not a member of 'node' [d:\work\contex
tify\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(661): error C2061: syntax error : identifier 'FreeCallback' [d:\work\contexti
fy\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(665): error C2065: 'callback' : undeclared identifier [d:\work\contextify\bui
ld\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(665): error C2065: 'hint' : undeclared identifier [d:\work\contextify\build\c
ontextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(672): error C2665: 'node::Buffer::New' : none of the 4 overloads could conver
t all the argument types [d:\work\contextify\build\contextify.vcxproj]
C:\Users\tomq\.node-gyp\4.1.2\include\node\node_buffer.h(43): could be 'v8::MaybeLocal<v8::Object> node::Buff
er::New(v8::Isolate *,char *,size_t)'
C:\Users\tomq\.node-gyp\4.1.2\include\node\node_buffer.h(31): or 'v8::MaybeLocal<v8::Object> node::Buff
er::New(v8::Isolate *,v8::Local<v8::String>,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
d:\work\contextify\node_modules\nan\nan.h(676): error C2664: 'v8::Local<v8::Object>::Local(const v8::Local<v8::Object>
&)' : cannot convert argument 1 from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object> &' [d:\work\contextif
y\build\contextify.vcxproj]
Reason: cannot convert from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object>'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be cal
led
d:\work\contextify\node_modules\nan\nan.h(683): error C2039: 'Use' : is not a member of 'node::Buffer' [d:\work\context
ify\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(683): error C3861: 'Use': identifier not found [d:\work\contextify\build\cont
extify.vcxproj]
I have read the Contextify Windows Install Guide, but it doesn't really help me. I have read many other posts as well.
Am I supposed to be able to get this to compile using Visual Studio 2013?
Thanks.
I've got same issue.
I've solved this problem.
Contextify is not supported in node 4.x.
So I've downgrade node to 0.10.x, then works fine.
Alyosha.

node-gyp rebuild fails installing stanford-corenlp on Windows 7

There are quite a few similar threads, which I thoroughly worked through this weekend, none of which contained the answer to my problem.
Installing the node package stanford-corenlp by calling
npm install stanford-corenlp
fails on my Windows 7 machine with the error output containing
npm ERR! Failed at the java#0.2.9 install script 'node-gyp rebuild'.
The first error displayed is:
child_process: customFds option is deprecated, use stdio instead.
This error ist followed by a few warnings and then hundreds of errors like these:
f:\appdata\roaming\npm\node_modules\stanford-corenlp\node_modules\java\src\java.h(10): error C2039: 'ObjectWrap' : is not a member of 'node' (..\src\java.cpp) [f:\AppData\Roaming\npm\node_modules\stanford-corenlp\node_modules\java\build\nodejavabridge_bindings.vcxproj]
f:\appdata\roaming\npm\node_modules\stanford-corenlp\node_modules\java\src\java.h(10): error C2504: 'ObjectWrap' : base class undefined (..\src\java.cpp) [f:\AppData\Roaming\npm\node_modules\stanford-corenlp\node_modules\java\build\nodejavabridge_bindings.vcxproj]
f:\appdata\roaming\npm\node_modules\stanford-corenlp\node_modules\java\src\java.h(23): error C2039: 'Arguments' : is not a member of 'v8' (..\src\java.cpp) [f:\AppData\Roaming\npm\node_modules\stanford-corenlp\node_modules\java\build\nodejavabridge_bindings.vcxproj]
f:\appdata\roaming\npm\node_modules\stanford-corenlp\node_modules\java\src\java.h(23): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\java.cpp) [f:\AppData\Roaming\npm\node_modules\stanford-corenlp\node_modules\java\build\nodejavabridge_bindings.vcxproj]
f:\appdata\roaming\npm\node_modules\stanford-corenlp\node_modules\java\src\java.h(23): error C2143: syntax error : missing ',' before '&' (..\src\java.cpp) [f:\AppData\Roaming\npm\node_modules\stanford-corenlp\node_modules\java\build\nodejavabridge_bindings.vcxproj]
...
..\src\java.cpp(43): error C2819: type 'v8::Persistent<T>' does not have an overloaded member 'operator ->'
..\src\java.cpp(43): error C2039: 'InstanceTemplate' : is not a member of 'v8::Persistent<T>'
..\src\java.cpp(43): error C2227: left of '->SetInternalFieldCount' must pointto class/struct/union/generic type
..\src\java.cpp(44): error C2819: type 'v8::Persistent<T>' does not have an overloaded member 'operator ->'
..\src\java.cpp(44): error C2039: 'SetClassName' : is not a member of 'v8::Persistent<T>'
..\src\java.cpp(44): error C2039: 'NewSymbol' : is not a member of 'v8::String'
..\src\java.cpp(44): error C3861: 'NewSymbol': identifier not found
..\src\java.cpp(46): error C2664: 'node::NODE_SET_PROTOTYPE_METHOD' : cannot convert parameter 1 from 'v8::Persistent<T>' to 'v8::Handle<T>'
...
At the moment I have 32-bit versions of, Python, Java-SDK and node.js installed and environment variables set. (I started with 64-bit versions with the same result.)
I installed the Visual Studio 2012 Express version.
I tried the Windows SDK version 8.1.
I tried calling the npm call from the SDK 6.1 (2008) command prompt.
I tried .NET 3.5 and 4.5.
I tried adding the
--msvs_version=2012
option to the npm call.
I tried updating node-gyp with
npm install node-gyp#latest
I would be grateful for any kind of input, especially the kind of input that makes me understand what is going on, so that I might figure out the solution by myself.
I think this should be related to node version. However I couldn't find .travis.yml file under stanford-corenlp so I have no clue of the min/max version it supports. I would recommend you to start with v10, then v8 and v6 to see if it works.
I guess this was related to the node modules java, the latest java#0.4.7 work's well. PS : I am the author of the node module stanford-corenlp.

Node.js npm installing websocket fails

I am installing websocket through npm in Windows 7 64 bit. The websocket version is 1.0.8
I am getting a linking error even though I have Visual Studio 2010 and Python 2.7 :
C:\Windows\system32\node_modules\websocket>node "C:\Program Files (x86)\nodejs\n
ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" r
ebuild
validation.cc
C:\Users\User\.node-gyp\0.10.30\deps\v8\include\v8.h(184): warning C4506: no d
efinition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Hand
le<T>)' [C:\Windows\system32\node_modules\websocket\build\validation.vcxproj]
with
[
T=v8::Object
]
LINK : fatal error LNK1104: cannot open file 'C:\Windows\system32\node_modules\w
ebsocket\build\Release\validation.node' [C:\Windows\system32\node_modules\websoc
ket\build\validation.vcxproj]
xor.cpp
C:\Users\User\.node-gyp\0.10.30\deps\v8\include\v8.h(179): warning C4506: no d
efinition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Hand
le<T>)' [C:\Windows\system32\node_modules\websocket\build\xor.vcxproj]
with
[
T=v8::Object
]
LINK : fatal error LNK1104: cannot open file 'C:\Windows\system32\node_modules\w
ebsocket\build\Release\xor.node' [C:\Windows\system32\node_modules\websocket\bui
ld\xor.vcxproj]
gyp[websocket v1.0.8]
Native code compile failed!!
Please note that this module DOES NOT REQUIRE the native components
and will still work without them, though not quite as efficiently.
On Windows, native extensions require Visual Studio and Python.
On Unix, native extensions require Python, make and a C++ compiler.
Start npm with --websocket:verbose to show compilation output (if any).
websocket#1.0.8 node_modules\websocket
C:\Windows\system32>
Is there a way to skip this compilation stuff and just use this module right away ? Or someway to fix this error ?
PS: the command prompt was started with Admin rights.

Weird linking error

My application is giving me a linking error when I try to build it.
Error 5 error LNK2001: unresolved external symbol "int __cdecl _AfxInitManaged(void)" (?_AfxInitManaged##YAHXZ) mfcs80ud.lib
I am building the application using Visual studio 2005. I am also linking against WINDDK for Server 2003 and Windows 6.1 SDK if this helps.
I Googled around and noticed people saying that its a precompiled header issue and it should be fixed by setting the /Yc switch in the stdafx.cpp Create/Use Precompiled header property. but that did not fix it for me and I'm not sure how to fix this.
Can someone help please.
I had same problem with Visual Studio 2010.
error LNK2001: unresolved external symbol "int __cdecl _AfxInitManaged
It turned out that was from my mistake to include another stdafx.cpp in other project.
Including more than one stdafx.cpp will produce this symptom.
Seems it solved it self once I restarted my machine.. not sure what was causing it in the first place, even restarting VS and cleaning the solution a gazillion times did not work.
Using Visual Studio 2005 to build a .NET 2003 solution, I encountered the described LNK2001 error. The project did not have a stdafx.cpp file. I added a copy of stdafx.cpp to the project and it built successfully.

Resources