zkat / npx

execute npm package binaries (moved)
https://github.com/npm/npx
Other
2.63k stars 105 forks source link

multiple packages fail #157

Closed bluelovers closed 6 years ago

bluelovers commented 6 years ago
npx --package rollup --package rollup-plugin-node-resolve --package rollup-plugin-commonjs -c "rollup -c"

Error: Cannot find module 'rollup-plugin-node-resolve'

rollup.config.js

import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';

var pkg = require('./package.json');

export default {
    input: 'index.js',
    name: pkg.name,
    plugins: [
        commonjs(),
        resolve(),
    ],
    output: [
        { file: pkg.main, format: 'umd' },
        { file: pkg.module, format: 'es' },
    ],
}
zkat commented 6 years ago

So this isn't something npx supports right now -- -p makes the binaries for that package available, not the library versions. I'm changing this, though, with #180 (assuming that lands), so this sort of thing will be possible.

zkat commented 6 years ago

Closing this as a dupe of #153