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

Make setup requirements a bit clearer #8

Closed
wants to merge 1 commit into from
Closed

Make setup requirements a bit clearer #8

wants to merge 1 commit into from

Conversation

mchapman
Copy link
Contributor

Make setup requirements a bit clearer

First install the toolchain with [NPM](https://www.npmjs.org/):
First install the command line tools globally with [NPM](https://www.npmjs.org/):
```shell
npm install --global gulp uglify-js2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --global flag is not necessary although it's probably more convenient to have gulp installed globally and not have to run it via npm.

The uglify-js dependency is already specified as a devDependency in the package.json though, so it does not need to be added this way.

I'm not sure our instructions should recommend a global install...

In other words, you can install Forms JS dependencies with only npm install and then if you want to install Gulp globally, you can also run npm install -g gulp (but it is not necessary).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you don't need to ask users install global dependency. I wrote about it in my blog. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got error messages and I thought this might stop other people having the same problems. But there may have been another cause.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What specific error(s) did you get?

I'm definitely a fan of having setup instructions be super clear and accurate. I did a clean install test, but it's possible I had something installed globally that I didn't realize...

Point me at the error and we'll get it sorted out! :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After I followed the instructions in the readme I got the following:

mark@mark-14:~/Projects/forms-js$ gulp build
No command 'gulp' found, did you mean:
 Command 'gslp' from package 'ghostscript' (main)
gulp: command not found
mark@mark-14:~/Projects/forms-js$ npm unbuild gulp
mark@mark-14:~/Projects/forms-js$ npm install -g gulp
/usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp/bin/gulp.js
gulp@3.8.11 /usr/local/lib/node_modules/gulp
├── v8flags@2.0.2
├── pretty-hrtime@0.2.2
├── interpret@0.3.10
├── deprecated@0.0.1
├── archy@1.0.0
├── minimist@1.1.1
├── semver@4.3.1
├── tildify@1.0.0 (user-home@1.1.1)
├── chalk@0.5.1 (ansi-styles@1.1.0, escape-string-regexp@1.0.3, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── orchestrator@0.3.7 (stream-consume@0.1.0, sequencify@0.0.7, end-of-stream@0.1.5)
├── gulp-util@3.0.4 (array-differ@1.0.0, beeper@1.0.0, object-assign@2.0.0, array-uniq@1.0.2, lodash._reevaluate@3.0.0, lodash._reescape@3.0.0, lodash._reinterpolate@3.0.0, replace-ext@0.0.1, vinyl@0.4.6, through2@0.6.3, chalk@1.0.0, dateformat@1.0.11, multipipe@0.1.2, lodash.template@3.3.2)
├── liftoff@2.0.2 (extend@2.0.0, flagged-respawn@0.3.1, resolve@1.1.5, findup-sync@0.2.1)
└── vinyl-fs@0.3.13 (graceful-fs@3.0.6, mkdirp@0.5.0, strip-bom@1.0.0, defaults@1.0.0, vinyl@0.4.6, through2@0.6.3, glob-stream@3.1.18, glob-watcher@0.0.6)
mark@mark-14:~/Projects/forms-js$ gulp build
[22:24:42] Using gulpfile ~/Projects/forms-js/gulpfile.js
[22:24:42] Starting 'build'...
[22:24:42] Starting 'compile'...
[22:24:42] Compiling TypeScript files using tsc version null
[22:24:43] Finished 'compile' after 738 ms
[22:24:43] Starting 'uglify'...
[22:24:43] Finished 'uglify' after 54 ms
[22:24:43] Starting 'umdify'...
[22:24:43] Finished 'umdify' after 57 ms
[22:24:43] Starting 'map'...
CWD: /home/mark/Projects/forms-js/dist
/bin/sh: 1: uglifyjs: not found
[22:24:43] 'map' errored after 61 ms
[22:24:43] Error in plugin 'gulp-shell'
Message:
    Command failed: /bin/sh: 1: uglifyjs: not found

Details:
    killed: false
    code: 127
    signal: null
    stdout: 
    stderr: /bin/sh: 1: uglifyjs: not found

[22:24:43] 'build' errored after 912 ms
[22:24:43] Error: [object Object]
    at formatError (/usr/local/lib/node_modules/gulp/bin/gulp.js:169:10)
    at Gulp.<anonymous> (/usr/local/lib/node_modules/gulp/bin/gulp.js:195:15)
    at Gulp.EventEmitter.emit (events.js:117:20)
    at Gulp.Orchestrator._emitTaskDone (/home/mark/Projects/forms-js/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
    at /home/mark/Projects/forms-js/node_modules/gulp/node_modules/orchestrator/index.js:275:23
    at finish (/home/mark/Projects/forms-js/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
    at cb (/home/mark/Projects/forms-js/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
    at finish (/home/mark/Projects/forms-js/node_modules/run-sequence/index.js:48:5)
    at Gulp.onError (/home/mark/Projects/forms-js/node_modules/run-sequence/index.js:55:4)
    at Gulp.EventEmitter.emit (events.js:117:20)
mark@mark-14:~/Projects/forms-js$ 

Doing a global install of uglify-js2 did not help, but then adding uglify-js did:

mark@mark-14:~/Projects/forms-js$ npm install -g uglify-js2
npm WARN deprecated uglify-js2@2.1.11: You can now install this using uglify-js@2.2.0 node_modules/uglify-js
npm WARN deprecated ├── source-map@0.1.8 (amdefine@0.0.4)
npm WARN deprecated └── optimist@0.3.5 (wordwrap@0.0.2)
/usr/local/bin/uglifyjs2 -> /usr/local/lib/node_modules/uglify-js2/bin/uglifyjs2
uglify-js2@2.1.11 /usr/local/lib/node_modules/uglify-js2
├── optimist@0.3.7 (wordwrap@0.0.2)
└── source-map@0.1.43 (amdefine@0.1.0)
mark@mark-14:~/Projects/forms-js$ gulp build
[22:27:43] Using gulpfile ~/Projects/forms-js/gulpfile.js
[22:27:43] Starting 'build'...
[22:27:43] Starting 'compile'...
[22:27:44] Compiling TypeScript files using tsc version null
[22:27:44] Finished 'compile' after 733 ms
[22:27:44] Starting 'uglify'...
[22:27:44] Finished 'uglify' after 55 ms
[22:27:44] Starting 'umdify'...
[22:27:44] Finished 'umdify' after 60 ms
[22:27:44] Starting 'map'...
CWD: /home/mark/Projects/forms-js/dist
/bin/sh: 1: uglifyjs: not found
[22:27:44] 'map' errored after 64 ms
[22:27:44] Error in plugin 'gulp-shell'
Message:
    Command failed: /bin/sh: 1: uglifyjs: not found

Details:
    killed: false
    code: 127
    signal: null
    stdout: 
    stderr: /bin/sh: 1: uglifyjs: not found

[22:27:44] 'build' errored after 914 ms
[22:27:44] Error: [object Object]
    at formatError (/usr/local/lib/node_modules/gulp/bin/gulp.js:169:10)
    at Gulp.<anonymous> (/usr/local/lib/node_modules/gulp/bin/gulp.js:195:15)
    at Gulp.EventEmitter.emit (events.js:117:20)
    at Gulp.Orchestrator._emitTaskDone (/home/mark/Projects/forms-js/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
    at /home/mark/Projects/forms-js/node_modules/gulp/node_modules/orchestrator/index.js:275:23
    at finish (/home/mark/Projects/forms-js/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
    at cb (/home/mark/Projects/forms-js/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
    at finish (/home/mark/Projects/forms-js/node_modules/run-sequence/index.js:48:5)
    at Gulp.onError (/home/mark/Projects/forms-js/node_modules/run-sequence/index.js:55:4)
    at Gulp.EventEmitter.emit (events.js:117:20)
mark@mark-14:~/Projects/forms-js$ npm install -g uglify-js
/usr/local/bin/uglifyjs -> /usr/local/lib/node_modules/uglify-js/bin/uglifyjs
uglify-js@2.4.17 /usr/local/lib/node_modules/uglify-js
├── uglify-to-browserify@1.0.2
├── async@0.2.10
├── yargs@1.3.3
└── source-map@0.1.34 (amdefine@0.1.0)
mark@mark-14:~/Projects/forms-js$ gulp build
[22:28:04] Using gulpfile ~/Projects/forms-js/gulpfile.js
[22:28:04] Starting 'build'...
[22:28:04] Starting 'compile'...
[22:28:04] Compiling TypeScript files using tsc version null
[22:28:05] Finished 'compile' after 744 ms
[22:28:05] Starting 'uglify'...
[22:28:05] Finished 'uglify' after 60 ms
[22:28:05] Starting 'umdify'...
[22:28:05] Finished 'umdify' after 62 ms
[22:28:05] Starting 'map'...
CWD: /home/mark/Projects/forms-js/dist
[22:28:05] Finished 'map' after 192 ms
[22:28:05] Finished 'build' after 1.06 s
mark@mark-14:~/Projects/forms-js$ 

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, yeah the initial gulp error makes sense because if you don't install it globally you won't be able to run it as gulp build. Rather you'll need to have NPM run it for you (e.g. npm run gulp build).

I'll take a closer look at your above error when I get home in a couple of hours. Hopefully it's just a matter of adding a new devDependency to the package.json and mentioning the note about npm run in the README. :)

@mchapman mchapman closed this Mar 12, 2015
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 this pull request may close these issues.

3 participants