Node.js 错误 - 返回 process.dlopen(module, path._makeLong(filename));

Posted

技术标签:

【中文标题】Node.js 错误 - 返回 process.dlopen(module, path._makeLong(filename));【英文标题】:Node.js error - return process.dlopen(module, path._makeLong(filename)); 【发布时间】:2018-03-06 00:47:07 【问题描述】:

return process.dlopen(module, path._makeLong(filename)) 出现以下错误

module.js:597
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: The specified procedure could not be found.
\\?\C:\SLIM_WORKSPACE\slim\slim-web\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64\binding.node
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\SLIM_WORKSPACE\slim\slim-web\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:211:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)

【问题讨论】:

我使用的是 windows 机器,并且我已经安装了所需的 Visual C++ 库。我应用了 npm 更新。但没有奏效。 我现在用npm rebuild,但问题依旧存在。 【参考方案1】:

我知道有点晚了,但这对我有用。

发出这些命令来帮助您删除/删除您的项目模块,然后更新它们

$rm -rf node_modules/
$npm update

【讨论】:

不幸的是,这并没有解决我的问题【参考方案2】:

您只需将您的 node 和 npm 包更新到最新版本。

$nvm install --lts    // For install Node latest version 
$npm update          // For update all NPM packages in latest version

$nvm alias default **versionName** // For steup node default version of your PC or server```

【讨论】:

这可能无法解决问题 - 该错误与未找到 .dll 有关,如果重新编译某个库,npm 更新可能会修复它。请注意,您需要 nvm 才能使用 nvm 更新节点。另外,这个问题大约有 2.5 年的历史,我不确定这个问题是否仍然存在。最后:欢迎堆砌:) 这是一个 npm 包问题。当 npm 包根据节点版本不工作时会发生这些类型的错误。解决这个问题的最佳方法是将节点和 npm 包更新到最新版本。这肯定对每个人都有效。是的,我的回答为时已晚,但它会帮助仍然面临同样问题的其他开发人员。 大家好,我看到了这个问题。我已经尝试了上述所有步骤: internal/modules/cjs/loader.js:1025 return process.dlopen(module, path.toNamespacedPath(filename)); ^ 错误:模块没有自行注册。在 Object.Module._extensions..node (internal/modules/cjs/loader.js:1025:18)【参考方案3】:

删除 node_modules 文件夹并以管理员身份使用 npm install 重新安装依赖项

【讨论】:

以上是关于Node.js 错误 - 返回 process.dlopen(module, path._makeLong(filename));的主要内容,如果未能解决你的问题,请参考以下文章

Node js - 因为没有回调函数而返回错误

Node.js - Express.js JWT 总是在浏览器响应中返回一个无效的令牌错误

Node.js 错误 - 返回 process.dlopen(module, path._makeLong(filename));

错误状态:使用 Node.js (express)、Angular 和 MongoDB 的 PUT 请求返回 404

使 Node.js Redis 客户端的 .multi() 和 .batch() 在结果中返回错误以进行测试

带有gmail api的node js,API返回错误:错误:未授权客户端