mmomtchev/pymport

install fails

Opened this issue ยท 10 comments

standard ubuntu 22.04
node v20.12.0
npm 10.5.0

npm install pymport

leads to:

npm ERR! code 7
npm ERR! path /data/dev/dev/snoot/snoot_pcd/node_modules/pymport
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build && node scripts/patch-prefix.js

What is the workaround to install pymport ?

Post the whole error message, I just tried installing it on the same configuration and it works for me.

As you may have seen from my profile, I am currently living on social welfare because of an extortion involving the French police, judicial system and many open source projects. In order to intimidate me, people are posting simultaneously issues on my project. Currently, they have been trying to post with an ever increasing time difference between those issues so that I stop saying what I am saying at the moment, all while it remains obvious to everyone.

Sorry to hear that, it sounds really crazy ;/

Here is the log file:
2024-03-31T18_06_21_757Z-debug-0.log

Try CXXFLAGS=-fpermissive npm install pymport to see if it fixes the prolem

Try npm install --verbose --foreground-scripts=true pymport

Yes, this one works, Installed!
Thanks!

But then import fails:

import { pymport, proxify } from 'pymport';


  VITE v5.2.7  ready in 149 ms

  โžœ  Local:   http://localhost:9500/
  โžœ  Network: use --host to expose
  โžœ  press h + enter to show help
โœ˜ [ERROR] No loader is configured for ".html" files: node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html

    node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js:86:21:
      86 โ”‚       return require('./' + command)(self, argvx, callback);
         โ•ต                      ~~~~~~~~~~~~~~

โœ˜ [ERROR] Could not resolve "mock-aws-s3"

    node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:43:28:
      43 โ”‚     const AWSMock = require('mock-aws-s3');
         โ•ต                             ~~~~~~~~~~~~~

  You can mark the path "mock-aws-s3" as external to exclude it from the bundle, which will remove
  this error and leave the unresolved path in the bundle. You can also surround this "require" call
  with a try/catch block to handle this failure at run-time instead of bundle-time.

โœ˜ [ERROR] Could not resolve "aws-sdk"

    node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:76:22:
      76 โ”‚   const AWS = require('aws-sdk');
         โ•ต                       ~~~~~~~~~

  You can mark the path "aws-sdk" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle. You can also surround this "require" call with
  a try/catch block to handle this failure at run-time instead of bundle-time.

โœ˜ [ERROR] Could not resolve "nock"

    node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:112:23:
      112 โ”‚   const nock = require('nock');
          โ•ต                        ~~~~~~

  You can mark the path "nock" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle. You can also surround this "require" call with
  a try/catch block to handle this failure at run-time instead of bundle-time.

08:47:39 [vite] error while updating dependencies:
Error: Build failed with 4 errors:
node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js:86:21: ERROR: No loader is configured for ".html" files: node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:43:28: ERROR: Could not resolve "mock-aws-s3"
node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:76:22: ERROR: Could not resolve "aws-sdk"
node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:112:23: ERROR: Could not resolve "nock"
    at failureErrorWithLog (/data/dev/dev/snoot/snoot_pcd/node_modules/esbuild/lib/main.js:1651:15)
    at /data/dev/dev/snoot/snoot_pcd/node_modules/esbuild/lib/main.js:1059:25
    at /data/dev/dev/snoot/snoot_pcd/node_modules/esbuild/lib/main.js:1527:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

And in the browser:
image

Should I open an other issue ?

No, you are trying to load pymport which is a Node.js addon into a web project. This does not work.

Oh yes, sorry