Skip to content

Instantly share code, notes, and snippets.

@henrjk
Last active August 29, 2015 14:07
Show Gist options
  • Save henrjk/676973b50bccb85dd57e to your computer and use it in GitHub Desktop.
Save henrjk/676973b50bccb85dd57e to your computer and use it in GitHub Desktop.
second invocation of yo has no permissions on root install
root@82a3836feef0:/# mkdir webapp
root@82a3836feef0:/# cd webapp
root@82a3836feef0:/webapp# yo webapp
[?] ==========================================================================
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve the tool over time?
More info: https://github.com/yeoman/insight & http://yeoman.io
==========================================================================: No
_-----_
| | .--------------------------.
|--(o)--| | Welcome to Yeoman, |
`---------´ | ladies and gentlemen! |
( _´U`_ ) '--------------------------'
/___A___\
| ~ |
__'.___.'__
´ ` |° ´ Y `
Out of the box I include HTML5 Boilerplate, jQuery, and a Gruntfile.js to build your app.
? What more would you like? Bootstrap
create Gruntfile.js
create package.json
create .gitignore
create .gitattributes
create .bowerrc
create bower.json
create .jshintrc
create .editorconfig
create app/styles/main.css
create app/favicon.ico
create app/robots.txt
create app/index.html
create app/scripts/main.js
invoke mocha
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
create test/bower.json
create test/.bowerrc
create test/spec/test.js
create test/index.html
npm WARN package.json webapp@ No description
npm WARN package.json webapp@ No repository field.
npm WARN package.json webapp@ No README data
> phantomjs@1.9.11 install /webapp/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs
> node install.js
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
Saving to /webapp/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2
Receiving...
/ [=======================================-] 98% 0.0s|
Received 12852K total.
Extracting tar contents (via spawned process)
Removing /webapp/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom
Copying extracted folder /webapp/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2-extract-1413916739342/phantomjs-1.9.7-linux-x86_64 -> /webapp/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom
Removing /webapp/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2-extract-1413916739342
Writing location.js file
Done. Phantomjs binary available at /webapp/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs
-
> jpegtran-bin@1.0.2 postinstall /webapp/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin
> node lib/install.js
fetch : https://raw.github.com/imagemin/jpegtran-bin/v1.0.2/vendor/linux/x64/jpegtran
progress : [====================] 100% 0.0s
✔ pre-build test passed successfully!
> gifsicle@1.0.3 postinstall /webapp/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle
> node lib/install.js
fetch : https://raw.github.com/imagemin/gifsicle-bin/v1.0.3/vendor/linux/x64/gifsicle
progress : [====================] 100% 0.0s
✔ pre-build test passed successfully!
> optipng-bin@1.0.1 postinstall /webapp/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin
> node lib/install.js
fetch : https://raw.github.com/imagemin/optipng-bin/v1.0.1/vendor/linux/x64/optipng
progress : [====================] 100% 0.0s
⚠ pre-build test failed, compiling from source...
✖ { [Error: Command failed: ] killed: false, code: 1, signal: null }
> pngquant-bin@1.0.1 postinstall /webapp/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin
> node lib/install.js
fetch : https://raw.github.com/imagemin/pngquant-bin/v1.0.1/vendor/linux/x64/pngquant
progress : [====================] 100% 0.0s
⚠ pre-build test failed, compiling from source...
✖ pngquant failed to build, make sure that libpng-dev is installed
{ [Error: Command failed: /bin/sh: 1: make: not found
] killed: false, code: 127, signal: null }
grunt-contrib-copy@0.5.0 node_modules/grunt-contrib-copy
grunt-rev@0.1.0 node_modules/grunt-rev
apache-server-configs@2.10.0 node_modules/apache-server-configs
grunt-contrib-clean@0.6.0 node_modules/grunt-contrib-clean
└── rimraf@2.2.8
grunt-concurrent@0.5.0 node_modules/grunt-concurrent
├── pad-stdio@0.1.1 (lpad@0.2.1)
└── async@0.2.10
jshint-stylish@0.4.0 node_modules/jshint-stylish
├── log-symbols@1.0.1
├── text-table@0.2.0
└── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
time-grunt@0.4.0 node_modules/time-grunt
├── figures@1.3.3
├── date-time@0.1.1
├── text-table@0.2.0
├── pretty-ms@0.2.2 (parse-ms@0.1.2)
├── hooker@0.2.3
└── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
grunt-newer@0.7.0 node_modules/grunt-newer
├── rimraf@2.2.6
└── async@0.2.10
grunt-contrib-concat@0.5.0 node_modules/grunt-contrib-concat
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
└── source-map@0.1.40 (amdefine@0.1.0)
grunt-contrib-watch@0.6.1 node_modules/grunt-contrib-watch
├── async@0.2.10
├── tiny-lr-fork@0.0.5 (debug@0.7.4, faye-websocket@0.4.4, noptify@0.0.3, qs@0.5.6)
├── gaze@0.5.1 (globule@0.1.0)
└── lodash@2.4.1
grunt-usemin@2.4.0 node_modules/grunt-usemin
├── debug@1.0.4 (ms@0.6.2)
└── lodash@2.4.1
load-grunt-tasks@0.4.0 node_modules/load-grunt-tasks
├── multimatch@0.1.0 (minimatch@0.2.14, lodash@2.4.1)
└── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1)
grunt-contrib-connect@0.8.0 node_modules/grunt-contrib-connect
├── connect-livereload@0.4.1
├── open@0.0.5
├── async@0.9.0
├── portscanner@0.2.3 (async@0.1.15)
└── connect@2.19.6 (parseurl@1.0.1, response-time@2.0.0, cookie@0.1.2, escape-html@1.0.1, pause@0.0.1, cookie-signature@1.0.3, vhost@1.0.0, fresh@0.2.2, qs@0.6.6, basic-auth-connect@1.0.0, on-headers@0.0.0, serve-favicon@2.0.1, bytes@1.0.0, morgan@1.1.1, errorhandler@1.0.2, cookie-parser@1.1.0, connect-timeout@1.1.0, body-parser@1.3.1, method-override@2.0.2, debug@1.0.2, express-session@1.2.1, csurf@1.2.1, type-is@1.2.1, compression@1.0.7, serve-static@1.2.3, multiparty@3.2.8, serve-index@1.1.1)
grunt-contrib-htmlmin@0.3.0 node_modules/grunt-contrib-htmlmin
├── pretty-bytes@0.1.2
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
└── html-minifier@0.6.9 (change-case@2.1.5, relateurl@0.2.5, clean-css@2.2.16, cli@0.6.5, uglify-js@2.4.15)
grunt@0.4.5 node_modules/grunt
├── dateformat@1.0.2-1.2.3
├── which@1.0.5
├── eventemitter2@0.4.14
├── getobject@0.1.0
├── rimraf@2.2.8
├── colors@0.6.2
├── async@0.1.22
├── hooker@0.2.3
├── grunt-legacy-util@0.2.0
├── nopt@1.0.10 (abbrev@1.0.5)
├── exit@0.1.2
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3)
├── lodash@0.9.2
├── coffee-script@1.3.3
├── underscore.string@2.2.1
├── iconv-lite@0.2.11
├── grunt-legacy-log@0.1.1 (underscore.string@2.3.3, lodash@2.4.1)
├── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1)
└── js-yaml@2.0.5 (esprima@1.0.4, argparse@0.1.15)
grunt-svgmin@0.4.0 node_modules/grunt-svgmin
├── each-async@0.1.3
├── pretty-bytes@0.1.2
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
└── svgo@0.4.5 (colors@0.6.2, whet.extend@0.9.9, coa@0.4.1, sax@0.6.1, js-yaml@2.1.3)
grunt-wiredep@1.9.0 node_modules/grunt-wiredep
└── wiredep@1.8.6 (propprop@0.3.0, minimist@1.1.0, chalk@0.5.1, through2@0.6.3, glob@4.0.6, lodash@2.4.1, bower-config@0.5.2)
grunt-contrib-cssmin@0.10.0 node_modules/grunt-contrib-cssmin
├── chalk@0.4.0 (ansi-styles@1.0.0, has-color@0.1.7, strip-ansi@0.1.1)
├── clean-css@2.2.16 (commander@2.2.0)
└── maxmin@0.2.2 (figures@1.3.3, pretty-bytes@0.1.2, chalk@0.5.1, gzip-size@0.2.0)
grunt-contrib-uglify@0.5.1 node_modules/grunt-contrib-uglify
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── uglify-js@2.4.15 (uglify-to-browserify@1.0.2, async@0.2.10, optimist@0.3.7, source-map@0.1.34)
├── lodash@2.4.1
└── maxmin@0.2.2 (figures@1.3.3, pretty-bytes@0.1.2, gzip-size@0.2.0)
grunt-contrib-jshint@0.10.0 node_modules/grunt-contrib-jshint
├── hooker@0.2.3
└── jshint@2.5.6 (strip-json-comments@1.0.2, underscore@1.6.0, exit@0.1.2, console-browserify@1.1.0, minimatch@1.0.0, shelljs@0.3.0, cli@0.6.5, htmlparser2@3.7.3)
grunt-autoprefixer@1.0.1 node_modules/grunt-autoprefixer
├── diff@1.0.8
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
└── autoprefixer-core@3.1.2 (postcss@2.2.5, caniuse-db@1.0.30000010)
grunt-mocha@0.4.11 node_modules/grunt-mocha
├── lodash@2.3.0
├── mocha@1.18.2 (diff@1.0.7, growl@1.7.0, commander@2.0.0, mkdirp@0.3.5, debug@2.1.0, glob@3.2.3, jade@0.26.3)
└── grunt-lib-phantomjs@0.4.0 (eventemitter2@0.4.14, semver@1.0.14, temporary@0.0.8, phantomjs@1.9.11)
grunt-contrib-imagemin@0.8.1 node_modules/grunt-contrib-imagemin
├── pretty-bytes@1.0.1 (get-stdin@1.0.0)
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── async@0.9.0
└── imagemin@1.0.5 (get-stdin@3.0.0, stat-mode@0.2.0, ware@0.3.0, nopt@3.0.1, tempfile@1.1.0, fs-extra@0.11.1, imagemin-svgo@1.0.2, imagemin-jpegtran@1.0.0, imagemin-gifsicle@1.0.0, imagemin-optipng@1.0.0, imagemin-pngquant@1.0.2)
root@82a3836feef0:/webapp#
FROM debian:wheezy
RUN apt-get update && apt-get install -y \
wget \
ca-certificates \
curl \
bzip2 \
git \
&& rm -rf /var/lib/apt/lists/*
# Source from https://github.com/docker-library/node/blob/51b1dd1984e287189106884c453ca506737eed78/0.10/Dockerfile
# verify gpg and sha256: http://nodejs.org/dist/v0.10.31/SHASUMS256.txt.asc
# gpg: aka "Timothy J Fontaine (Work) <tj.fontaine@joyent.com>"
RUN gpg --keyserver pgp.mit.edu --recv-keys 7937DFD2AB06298B2293C3187D33FF9D0246406D
ENV NODE_VERSION 0.10.32
ENV NPM_VERSION 2.1.2
RUN curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \
&& curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --verify SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-x64.tar.gz\$" SHASUMS256.txt.asc | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-x64.tar.gz" SHASUMS256.txt.asc \
&& npm install -g npm@"$NPM_VERSION"
# install yeoman
RUN npm install -g \
yo \
generator-webapp
root@82a3836feef0:/webapp# mkdir /webapp2
root@82a3836feef0:/webapp# cd /webapp2
root@82a3836feef0:/webapp2# yo webapp
_-----_
| | .--------------------------.
|--(o)--| | Welcome to Yeoman, |
`---------´ | ladies and gentlemen! |
( _´U`_ ) '--------------------------'
/___A___\
| ~ |
__'.___.'__
´ ` |° ´ Y `
Out of the box I include HTML5 Boilerplate, jQuery, and a Gruntfile.js to build your app.
? What more would you like? Bootstrap
/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/node_modules/mkdirp/index.js:89
throw err0;
^
Error: EACCES, permission denied '/webapp2/app'
at Object.fs.mkdirSync (fs.js:653:18)
at sync (/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/node_modules/mkdirp/index.js:70:13)
at Function.sync (/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/node_modules/mkdirp/index.js:76:24)
at module.exports.yeoman.generators.Base.extend.app (/usr/local/lib/node_modules/generator-webapp/app/index.js:180:10)
at /usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/lib/base.js:395:14
at processImmediate [as _immediateCallback] (timers.js:345:15)
root@82a3836feef0:/webapp2#

Steps:

1: Environment Mac OSX with docker 1.3.0 and boot2docker 1.3.0 (Boot2Docker-cli version: v1.3.0 Git commit: deafc19)

2: Derived a docker image based on debian to experiment with yo generators see DockerFile.

3: Built image using command: docker build -t yowebapp .

4: Run container docker run -it yowebapp /bin/bash

5: Inside container see docker container first invocation: The sample webapp is generated in folder /webapp using the command yo webapp. The question to improve yeoman was answered with no, otherwise defaults were used. For me this took about 5 minutes. There was one issue that I haven't fully investigated regarding pre-build test failed, compiling from source.... However I believe this has no bearing on the issue described here.

6: Continuing inside container see docker container continuation: Changed to a newly created directory /webapp2 and generated the example again. This time there is a permission denied problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment