node.js - 错误 C2039: 'IsNearDeath' : 不是 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>> 的成员

标签 node.js angular npm visual-studio-code

我最近将我的 nodejs 升级到 v12.3.1,现在当我尝试在项目存储库中运行 npm install 时,我得到前面的错误。

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 时面临同样的问题吗?

最佳答案

我能够在 Node v12.13.1 上解决这个问题(至少对我来说):

  • 删除 package-lock.json
  • 删除node_modules目录
  • 重新运行 npm install

查看 package-lock.json 的差异可以发现,一些有问题的包显然已经过时了:

enter image description here

关于node.js - 错误 C2039: 'IsNearDeath' : 不是 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>> 的成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56391303/

相关文章:

angular - 如何在 Angular 应用程序中使用 Puppeteer

angular - 在 IIS 上设置 Angular 深度链接

node.js - 无法在 ubuntu 16.04 上安装 npm 包

node.js - 在 Express Node 应用程序中使用 connect-livereload

javascript - react 组件库的 cjs 或 esm

javascript - url应该以编码形式还是解码形式存储?

css - Angular 2 - 到处都是重复的 &lt;style&gt; block

jenkins - 在 Jenkins 中,有没有办法保留 npm 包,这样我就不必在每个构建中安装它们?

javascript - 使用 phantomjs-node 实现 waitFor 功能

javascript - Express、WS、WebSocket、Express-WS