Skip to content

Broken command line outpipe #68

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

Closed
ctumolosus opened this issue Jun 1, 2015 · 7 comments
Closed

Broken command line outpipe #68

ctumolosus opened this issue Jun 1, 2015 · 7 comments

Comments

@ctumolosus
Copy link

According to the command line outpipe example section in the README file I should be able to run this command:

browserify ./assets/scripts/*.js -p [ factor-bundle -o 'uglify-js -cm > ./public/scripts/`basename $FILE`.js' ] -o ./public/scripts/common.js

But I'm getting the following error:

var outputs = defined(outopt, []).map(function (o) {
                                      ^
TypeError: undefined is not a function
    at f (/project/node_modules/factor-bundle/index.js:34:39)
    at Browserify.plugin (/project/node_modules/browserify/index.js:350:9)
    at /project/node_modules/browserify/bin/args.js:102:15
    at Array.forEach (native)
    at module.exports (/project/node_modules/browserify/bin/args.js:97:10)
    at Object.<anonymous> (/project/node_modules/browserify/bin/cmd.js:6:26)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
@ghost
Copy link

ghost commented Jun 1, 2015

Try with 2.4.1.

@ctumolosus
Copy link
Author

@substack I tried using 2.4.1 and i'm running into a different problem. I'm trying to figure out whether it was caused by something that I missed. I have a feeling that something is treating the value of the --output option as the path of a file to be read.

browserify ./assets/scripts/*.js -p [ factor-bundle -o 'uglifyjs -cm > ./public/scripts/`basename $FILE`.js' ] -o ./public/scripts/common.js

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: ENOENT, open 'uglifyjs -cm > ./public/scripts/`basename $FILE`.js'
    at Error (native)

Log in npm-debug.log isn't helping me too much:

0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli   '/user/.nvm/versions/node/v0.12.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build:scripts' ]
2 info using npm@2.7.3
3 info using node@v0.12.0
4 verbose run-script [ 'prebuild:scripts', 'build:scripts', 'postbuild:scripts' ]
5 info prebuild:scripts project@0.1.0
6 info build:scripts project@0.1.0
7 verbose unsafe-perm in lifecycle true
8 info project@0.1.0 Failed to exec build:scripts script
9 verbose stack Error: project@0.1.0 build:scripts: `browserify ./assets/scripts/*.js -p [ factor-bundle -o 'uglifyjs -cm > ./public/scripts/`basename $FILE`.js' ] -o ./public/scripts/common.js`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (/user/.nvm/versions/node/v0.12.0/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (/user/.nvm/versions/node/v0.12.0/lib/node_modules/npm/lib/utils/spawn.js:14:12)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1008:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
10 verbose pkgid project@0.1.0
11 verbose cwd /user/project
12 error Darwin 13.4.0
13 error argv "node" "/user/.nvm/versions/node/v0.12.0/bin/npm" "run" "build:scripts"
14 error node v0.12.0
15 error npm  v2.7.3
16 error code ELIFECYCLE
17 error project@0.1.0 build:scripts: `browserify ./assets/scripts/*.js -p [ factor-bundle -o 'uglifyjs -cm > ./public/scripts/`basename $FILE`.js' ] -o ./public/scripts/common.js`
17 error Exit status 1
18 error Failed at the project@0.1.0 build:scripts script 'browserify ./assets/scripts/*.js -p [ factor-bundle -o 'uglifyjs -cm > ./public/scripts/`basename $FILE`.js' ] -o ./public/scripts/common.js'.
18 error This is most likely a problem with the project package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     browserify ./assets/scripts/*.js -p [ factor-bundle -o 'uglifyjs -cm > ./public/scripts/`basename $FILE`.js' ] -o ./public/scripts/common.js
18 error You can get their info via:
18 error     npm owner ls project
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

@paulcpederson
Copy link

+1 in the same boat with both errors.

@ghost
Copy link

ghost commented Jun 1, 2015

Do you have uglifyjs and basename in your $PATH? Are you on windows?

@paulcpederson
Copy link

both in $PATH I'm on a mac.

I made a simple test repo just as a sanity check thinking it might be something in my setup, but I get the same error. (Same as above). Put the sample on GitHub here: https://github.com/paulcpederson/factor-bundle-test

Been running browserify via an npm script. npm run js to test. Can you spot something I did wrong here?

@ctumolosus
Copy link
Author

I have the same setup as @paulcpederson

@ctumolosus
Copy link
Author

By the way, I tried with:

npm install substack/factor-bundle#e6c7ceb6c8963bac254c1e4b123c06ac45e99039

and I'm not getting errors.

jcppman added a commit to jcppman/factor-bundle that referenced this issue Jun 19, 2015
fix browserify#68, browserify#59

- To avoid writing to ended writeStream, outputs will be constructed everytime
- In the scenario that user wanna use outpipe, the `outopt` will be
kept as string, so we can determine the user's attempt in later codes
and do the relavant opperations
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

Successfully merging a pull request may close this issue.

2 participants