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
> [email protected] 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
-
> [email protected] 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!
> [email protected] 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!
> [email protected] 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 }
> [email protected] 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 }
[email protected] node_modules/grunt-contrib-copy
[email protected] node_modules/grunt-rev
[email protected] node_modules/apache-server-configs
[email protected] node_modules/grunt-contrib-clean
└── [email protected]
[email protected] node_modules/grunt-concurrent
├── [email protected] ([email protected])
└── [email protected]
[email protected] node_modules/jshint-stylish
├── [email protected]
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/time-grunt
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/grunt-newer
├── [email protected]
└── [email protected]
[email protected] node_modules/grunt-contrib-concat
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected])
[email protected] node_modules/grunt-contrib-watch
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected]
[email protected] node_modules/grunt-usemin
├── [email protected] ([email protected])
└── [email protected]
[email protected] node_modules/load-grunt-tasks
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected])
[email protected] node_modules/grunt-contrib-connect
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/grunt-contrib-htmlmin
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/grunt
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected])
[email protected] node_modules/grunt-svgmin
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/grunt-wiredep
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/grunt-contrib-cssmin
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/grunt-contrib-uglify
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected])
[email protected] node_modules/grunt-contrib-jshint
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/grunt-autoprefixer
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected])
[email protected] node_modules/grunt-mocha
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/grunt-contrib-imagemin
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
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) <[email protected]>"
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