Comments (4)
See also TryGhost/node-sqlite3#248
from node-pre-gyp.
@cscott okay, this feature is ready to test as of 1670153. Please see the test apps in test/
for examples. Can you give this a try?
from node-pre-gyp.
Done in v0.5.x. This is now opt-in and as simple as adding versioned variables to module_path
like was done for node-sqlite3 in TryGhost/node-sqlite3@5c2593d:
"module_path": "./lib/binding/{node_abi}-{platform}-{arch}",
from node-pre-gyp.
I am having an issue supporting multiple platforms. I am probably doing something wrong. I am making a grunt task to pre-gyp serialport for packaging in nodewebkit runtimes for several supported platforms. I am building up the argv
& using prog.parseArgv(argv);
to accomplish this:
var gulp = require('gulp'),
NodePreGyp = require('node-pre-gyp'),
path = require('path');
var supported = ['win32:ia32', 'darwin:x64', 'linux:ia32', 'linux:x64'];
var nw_version = '0.11.2';
function pregyp(module, done){
process.chdir(path.join(__dirname, 'node_modules',module));
var prog = new NodePreGyp.Run();
var argv = ['node', 'node-pre-gyp', '--runtime=node-webkit', '--fallback-to-build', '--target=' + nw_version];
supported.forEach(function(p){
var plat = p.split(':');
[ 'install',
'--target_platform=' + plat[0],
'--target_arch=' + plat[1]
].forEach(function(c){ argv.push(c); });
});
console.log(argv.join(' '))
prog.parseArgv(argv);
function run(){
var command = prog.todo.shift();
if (!command) {
return done();
}
prog.commands[command.name](command.args, function(err){
if (err) return done(err);
process.nextTick(run);
});
}
run();
}
gulp.task('pregyp:serial', function(done){
pregyp('serialport', done);
});
This, given my understanding of how this module works, build roughly the same thing as this:
node node-pre-gyp --runtime=node-webkit --fallback-to-build --target=0.11.2 install --target_platform=win32 --target_arch=ia32 install --target_platform=darwin --target_arch=x64 install --target_platform=linux --target_arch=ia32 install --target_platform=linux --target_arch=x64
When I run this, it does it's thing, and downloads some pre-builts and builds some stuff, without errors, but they all get copied to node_modules/serialport/build/serialport/v1.4.9/Release/node-webkit-v0.11.2-win32,darwin,linux,linux-ia32,x64,ia32,x64/serialport.node
What am I doing wrong?
from node-pre-gyp.
Related Issues (20)
- Compatible with Windows system path
- React-Native: npm install - npm ERR! path /Users/rs68122/Documents/Morrision/TAS/TAS/node_modules/sqlite3
- Cross compilation on mac for windows
- prebuild files not fetched when using registry-proxy HOT 2
- Uncaught Error: 无法引入模块 child_process
- Use http for tarball binaries HOT 1
- Compatibility with MSYS2
- Bizarre errors in npm install... HOT 2
- vue-cli-service build Failed to compile with 5 errors
- Security: reject 3rd unsigned party binaries
- How to build for all available platforms? HOT 1
- Vulnerability warning due to make-dir version HOT 7
- replace `rimraf` with native rm
- Getting error: @mapbox/node-pre-gyp/.github/workflows/codeql.yml: special characters are not allowed
- I am getting error while working with Nextjs app directory - error ./node_modules/@mapbox/node-pre-gyp/lib/clean.js:8:0 Module not found: Can't resolve 'fs' Import trace for requested module: ./node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$ ./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js ./node_modules/argon2/argon2.js ./node_modules/next-auth-sanity/credentials.js ./node_modules/next-auth-sanity/index.js ./src/lib/auth.ts ./src/lib/index.ts ./src/app/upload/page.tsx HOT 4
- Upgrade to semver > 7.5.2 HOT 1
- Security issue in node-fetch < 2.7.0
- pos
- Allow forcing local build with environment variables
- Vulnerability in inflight HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-pre-gyp.