Carlos
Carlos

Reputation: 13

Error in ./node_modules/node-libcurl/lib/binding/node_libcurl.node

I'm a C++ developer and beginner in the Node world.
I would like to create a CEP and VUE based Photoshop plugin.
The skeleton plugin works well.
I would like to use node-libcurl package for this plugin.

I installed libcurl - It's OK.

npm i node-libcurl --save

I put down into my 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

ERROR Failed to compile with 1 error
7:26:51 PM error in ./node_modules/node-libcurl/lib/binding/node_libcurl.node

Module parse failed: Unexpected character '�' (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)

@ ./node_modules/node-libcurl/dist/Easy.js 5:17-60
@ ./node_modules/node-libcurl/dist/index.js
@ ./src/c4/C4.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

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

Upvotes: -1

Views: 387

Answers (1)

Carlos
Carlos

Reputation: 13

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

Upvotes: 0

Related Questions