2

Hi I am building docker image from node js project.

docker files contents are like below

fetch code from git repo. install npm install grunt cli grunt build

please see below docker file

FROM    ubuntu:latest
# Install Node.js and npm
RUN    apt-get -y update
RUN    apt-get -y install nodejs npm git wget curl
RUN     git config --global http.sslverify false
WORKDIR /somerepo/
RUN git clone -somerepo
WORKDIR /somerepo/src/
RUN     npm cache clean -f
RUN     npm install -g n
RUN     n stable
RUN     npm install
RUN     npm install -g grunt-cli
RUN     grunt build
EXPOSE  3000
CMD ["node", "web.js"]

but its grunt build step is failing below error in logs

Step 14/15 : RUN grunt build ---> Running in d0f8863081f1

Local Npm module "jshint-stylish" not found. Is it installed?

Running "clean:dist" (clean) task

... ... ...

Running "githooks:all" (githooks) task

Binding jsbeautifier:pregit to pre-commit Git hook. OK

Running "jshint:dev" (jshint) task Warning: The "path" argument must be of type string. Received type object Use --force to continue.

Do any have any idea why grunt build is not ending successufully ?

I have already tried --save-dev option and also tried manually installing jshint with below command

#RUN npm install --save-dev jshint-stylish

Also i tried to print the files/directories having pattern "jshint" with below command in dockerfile

RUN find . -name "*jshint*"

and its printing below output in logs

Step 13/15 : RUN find . -name "*jshint*"
 ---> Running in db355c19f75a
./node_modules/.bin/jshint
./node_modules/ascii-table/.jshintrc
./node_modules/bl/.jshintrc
./node_modules/errno/.jshintrc
./node_modules/escodegen/.jshintrc
./node_modules/estraverse/.jshintrc
./node_modules/exit/.jshintrc
./node_modules/findup-sync/.jshintrc
./node_modules/gaze/.jshintrc
./node_modules/getobject/.jshintrc
./node_modules/globule/.jshintrc
./node_modules/grunt-contrib-clean/.jshintrc
./node_modules/grunt-contrib-compress/.jshintrc
./node_modules/grunt-contrib-concat/.jshintrc
./node_modules/grunt-contrib-cssmin/.jshintrc
./node_modules/grunt-contrib-jshint
./node_modules/grunt-contrib-jshint/tasks/jshint.js
./node_modules/grunt-contrib-jshint/tasks/lib/jshint.js
./node_modules/grunt-contrib-uglify/.jshintrc
./node_modules/grunt-contrib-watch/.jshintrc
./node_modules/grunt-express-server/.jshintrc
./node_modules/grunt-git-describe/.jshintrc
./node_modules/grunt-githooks/.jshintrc
./node_modules/grunt-img/node_modules/.bin/jshint
./node_modules/grunt-img/node_modules/grunt-contrib-jshint
./node_modules/grunt-img/node_modules/grunt-contrib-jshint/.jshintrc
./node_modules/grunt-img/node_modules/grunt-contrib-jshint/docs/jshint-examples.md
./node_modules/grunt-img/node_modules/grunt-contrib-jshint/docs/jshint-options.md
./node_modules/grunt-img/node_modules/grunt-contrib-jshint/docs/jshint-overview.md
./node_modules/grunt-img/node_modules/grunt-contrib-jshint/tasks/jshint.js
./node_modules/grunt-img/node_modules/grunt-contrib-jshint/tasks/lib/jshint.js
./node_modules/grunt-img/node_modules/grunt-contrib-jshint/test/jshint_test.js
./node_modules/grunt-img/node_modules/jshint
./node_modules/grunt-img/node_modules/jshint/packages/jshint
./node_modules/grunt-img/node_modules/jshint/packages/jshint/jshint.js
./node_modules/grunt-jsbeautifier/.jshintrc
./node_modules/grunt-json-replace/.jshintrc
./node_modules/grunt-legacy-log/.jshintrc
./node_modules/grunt-legacy-log-utils/.jshintrc
./node_modules/grunt-legacy-util/.jshintrc
./node_modules/grunt-lib-contrib/.jshintrc
./node_modules/grunt-manifest/.jshintrc
./node_modules/grunt-prettify/.jshintrc
./node_modules/grunt-sloc/.jshintrc
./node_modules/grunt-sloccount/.jshintrc
./node_modules/grunt-text-replace/.jshintrc
./node_modules/handlebars/.jshintrc
./node_modules/ibrik/node_modules/estraverse/.jshintrc
./node_modules/isstream/.jshintrc
./node_modules/istanbul/node_modules/estraverse/.jshintrc
./node_modules/jshint
./node_modules/jshint/bin/jshint
./node_modules/jshint/src/jshint.js
./node_modules/jshint-stylish
./node_modules/keep-alive-agent/.jshintrc
./node_modules/less/.idea/jsLinters/jshint.xml
./node_modules/less/.jshintrc
./node_modules/log4js/.jshintrc
./node_modules/nodemon/.jshintrc
./node_modules/phantomjs/.jshintrc
./node_modules/promise/.jshintrc
./node_modules/prr/.jshintrc
./node_modules/request-progress/.jshintrc
./node_modules/resolve-url/.jshintrc
./node_modules/restify/node_modules/qs/.jshintignore
./node_modules/restify/node_modules/qs/.jshintrc
./node_modules/save/.jshintignore
./node_modules/save/.jshintrc
./node_modules/shelljs/jshint.json
./node_modules/source-map-resolve/.jshintrc
./node_modules/source-map-url/.jshintrc
./node_modules/undefsafe/.jshintrc
./node_modules/urix/.jshintrc
./node_modules/xtend/.jshintrc

if anyone have any idea what is wrong please let me know

Thanks in advance !!!

Ramandeep Mehmi
  • 81
  • 1
  • 13
  • Possible duplicate of [Error Local Npm module "jshint-stylish" not found when it exists locally (via symlink)](https://stackoverflow.com/questions/24143154/error-local-npm-module-jshint-stylish-not-found-when-it-exists-locally-via-sy) – GrafiCode Sep 16 '19 at 10:00
  • Already gone through that link, didn't work for me !!!! – Ramandeep Mehmi Sep 16 '19 at 15:01

0 Answers0