错误C2039:'IsNearDeath':不是'Nan :: Persistent< v8 :: Object,v8 :: NonCopyablePersistentTraits< T>的成员. [英] error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8 ::NonCopyablePersistentTraits<T>>
问题描述
我最近将我的nodejs
升级到了v12.3.1
,现在当我尝试在项目存储库中运行npm install
时,遇到了前面的错误.
I recently upgraded my nodejs
to v12.3.1
, and now when I try to run npm install
in my project repository, I am getting the preceding errors.
error C2059: syntax error: ')' (compiling source file ..\src\custo
m_importer_bridge.cpp)
error C2660: 'v8::StringObject::New': function does not take 1 arg
uments (compiling source file ..\src\sass_context_wrapper.cpp)
node_modules\nan\nan_object_wrap.h(127): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v
8::NonCopyablePersistentTraits<T>>'
我尝试过的事情
- 删除了node_modules文件夹并运行
npm install
- 关闭vscode,然后再次打开解决方案
- 将npm更新为最新版本
还有其他人遇到与v12.3.1
相同的问题吗?
Anyone else are facing the same issue with v12.3.1
?
推荐答案
我已经尝试了很多方法来解决此问题.看来版本v12.3.1
尚未稳定.作为一种解决方法,我安装了版本v10.16.0
并解决了该问题.由于我以前安装了最新版本(v12.3.1
),因此Node.js不允许我安装较低版本,因此我必须卸载Node.js并安装v10.16.0
.希望对您有所帮助.
I have tried many things to solve this issue. It seems like the version v12.3.1
is not stable yet. As a workaround, I installed the version v10.16.0
and that fixed the issue. As I had installed the latest version previously (v12.3.1
) the Node.js was not allowing me to install a lower version, so I had to uninstall the Node.js and install the v10.16.0
. I hope it helps.
更新:
正如@forsunnet在他的评论中提到的,该问题也与13.12版本有关,回到11.x版本为他解决了该问题.
As @forsunnet mentioned in his comment, the issue is with the version 13.12 too, going back to version 11.x solved the issue for him.
这篇关于错误C2039:'IsNearDeath':不是'Nan :: Persistent< v8 :: Object,v8 :: NonCopyablePersistentTraits< T>的成员.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!