简体   繁体   English

/node_modules/node-libcurl/lib/binding/node_libcurl.node 中的错误

[英]Error in ./node_modules/node-libcurl/lib/binding/node_libcurl.node

I'm a C++ developer and beginner in the Node world.我是 Node 世界的 C++ 开发人员和初学者。
I would like to create a CEP and VUE based Photoshop plugin.我想创建一个基于 CEP 和 VUE 的 Photoshop 插件。
The skeleton plugin works well.骨架插件运行良好。
I would like to use node-libcurl package for this plugin.我想为这个插件使用 node-libcurl package。

I installed libcurl - It's OK.我安装了 libcurl - 没关系。

npm i node-libcurl --save

I put down into my C4.js我放下了我的 C4.js

const { curly } = require('node-libcurl');

When I want to build my project I got this error:当我想构建我的项目时,我收到了这个错误:

INFO Starting development server... 98% after emitting CopyPlugin INFO 启动开发服务器... 98% 在发出 CopyPlugin 后

ERROR Failed to compile with 1 error ERROR 编译失败,出现 1 个错误
7:26:51 PM error in./node_modules/node-libcurl/lib/binding/node_libcurl.node 7:26:51 PM 错误在./node_modules/node-libcurl/lib/binding/node_libcurl.node

Module parse failed: Unexpected character '�' (1:2)模块解析失败:意外字符 '�' (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.您可能需要适当的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件。 See https://webpack.js.org/concepts#loaders (Source code omitted for > > this binary file)https://webpack.js.org/concepts#loaders (源代码省略 > > 这个二进制文件)

@./node_modules/node-libcurl/dist/Easy.js 5:17-60 @./node_modules/node-libcurl/dist/Easy.js 5:17-60
@./node_modules/node-libcurl/dist/index.js @./node_modules/node-libcurl/dist/index.js
@./src/c4/C4.js @./src/c4/C4.js
@./src/main.js @./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.22:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js./src/main.js @multi (webpack)-dev-server/client?http://192.168.1.22:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js./src/main.js

I tried this webpack.config.js in.... \node_modules\node-libcurl我试过这个 webpack.config.js 在.... \node_modules\node-libcurl

module.exports = {
  target: "node",
  node: {
    __dirname: false,
  },
  module: {
    rules: [
      {
        test: /\.node$/,
        loader: "node-loader",
      },
    ],
  },
};

... but it did not work. ...但它没有用。

I appreciate any help我很感激任何帮助
Thx: Carlos谢谢:卡洛斯

It was my fail.这是我的失败。

I got answer from developer.我得到了开发人员的答复。

This library is not supposed to work in the Browser, it is a backend-only library.这个库不应该在浏览器中工作,它是一个仅限后端的库。

/Carlos /卡洛斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM