Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install fails #175

Open
sfornengo opened this issue Mar 31, 2024 · 10 comments
Open

install fails #175

sfornengo opened this issue Mar 31, 2024 · 10 comments

Comments

@sfornengo
Copy link

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 ?

@mmomtchev
Copy link
Owner

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

@mmomtchev
Copy link
Owner

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.

@sfornengo
Copy link
Author

Sorry to hear that, it sounds really crazy ;/

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

@mmomtchev
Copy link
Owner

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

@sfornengo
Copy link
Author

Nope, same

2024-03-31T20_59_37_946Z-debug-0.log

@mmomtchev
Copy link
Owner

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

@sfornengo
Copy link
Author

Yes, this one works, Installed!
Thanks!

@sfornengo
Copy link
Author

sfornengo commented Apr 1, 2024

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 ?

@mmomtchev
Copy link
Owner

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

@sfornengo
Copy link
Author

Oh yes, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants