Open suso2 opened 6 years ago
Hi, in the setup-npm.sh
remove the --silent
flag so you can see the errors. I think that when it tries to install this packages node-sass@3.8.0 clean-css@3.4.24 uglify-js requirejs
it fails somewhere.
The error above it's just an effect of not installing those packages.
Thanks. I removed the --silent flag.
Step 8/23 : RUN /tmp/setup-npm.sh ---> Running in f78f40b3d3e6 /usr/bin/r.js -> /usr/lib/node_modules/requirejs/bin/r.js /usr/bin/r_js -> /usr/lib/node_modules/requirejs/bin/r.js /usr/bin/uglifyjs -> /usr/lib/node_modules/uglify-js/bin/uglifyjs npm WARN engine request@2.83.0: wanted: {"node":">= 4"} (current: {"node":"2.5.0","npm":"2.13.2"}) /usr/bin/cleancss -> /usr/lib/node_modules/clean-css/bin/cleancss npm WARN engine har-validator@5.0.3: wanted: {"node":">=4"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine sntp@2.1.0: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine cryptiles@3.1.2: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine hoek@4.2.1: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine boom@4.3.1: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine har-schema@2.0.0: wanted: {"node":">=4"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine boom@5.2.0: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) /usr/bin/node-sass -> /usr/lib/node_modules/node-sass/bin/node-sass
node-sass@3.8.0 install /usr/lib/node_modules/node-sass node scripts/install.js
/usr/lib/node_modules/node-sass/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js:375
exports.unique = (array, key) => {
^^
SyntaxError: Unexpected token =>
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
at Object.Module._extensions..js (module.js:448:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
npm ERR! node-sass@3.8.0 install: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.8.0 install script 'node scripts/install.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /npm-debug.log ERROR: Service 'static' failed to build: The command '/bin/sh -c /tmp/setup-npm.sh' returned a non-zero code: 1
Has anyone run into the same problem?
Hmm... this is what I thought, it's failing when you are installing the packages. So now that we can see the actual errors. What you should try is the following:
--unsafe-perm
to the npm
script like so: npm update && npm install -g --unsafe-perm node-sass@3.8.0 clean-css@3.4.24 uglify-js requirejs
and try again and if it's failing then you should do the Step 2
sudo ln -s `which nodejs` /usr/bin/node
or if you are using non-standard shells just hardcode which nodejs
with sudo ln -s /usr/bin/nodejs /usr/bin/node
and run the docker command again.Edited...
Hi and thanks again. I tried but it did not work...
Step 8/23 : RUN /tmp/setup-npm.sh ---> Running in 08d16203482e /usr/bin/r.js -> /usr/lib/node_modules/requirejs/bin/r.js /usr/bin/r_js -> /usr/lib/node_modules/requirejs/bin/r.js /usr/bin/uglifyjs -> /usr/lib/node_modules/uglify-js/bin/uglifyjs npm WARN engine request@2.83.0: wanted: {"node":">= 4"} (current: {"node":"2.5.0","npm":"2.13.2"}) /usr/bin/cleancss -> /usr/lib/node_modules/clean-css/bin/cleancss npm WARN engine har-validator@5.0.3: wanted: {"node":">=4"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine cryptiles@3.1.2: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine sntp@2.1.0: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine hoek@4.2.1: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine boom@4.3.1: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine har-schema@2.0.0: wanted: {"node":">=4"} (current: {"node":"2.5.0","npm":"2.13.2"}) npm WARN engine boom@5.2.0: wanted: {"node":">=4.0.0"} (current: {"node":"2.5.0","npm":"2.13.2"}) /usr/bin/node-sass -> /usr/lib/node_modules/node-sass/bin/node-sass
node-sass@3.8.0 install /usr/lib/node_modules/node-sass node scripts/install.js
/usr/lib/node_modules/node-sass/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js:375
exports.unique = (array, key) => {
^^
SyntaxError: Unexpected token =>
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
at Object.Module._extensions..js (module.js:448:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
npm ERR! node-sass@3.8.0 install: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.8.0 install script 'node scripts/install.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /npm-debug.log ERROR: Service 'static' failed to build: The command '/bin/sh -c /tmp/setup-npm.sh' returned a non-zero code: 1
I thought docker worked without any configuration... Anyway I am installing it on my laptop (Ubuntu 16.04 LTS).
The problem is not with the docker the problem is that it fails to install those packages on your system. :( When you are able to install those packages on your system then the docker should work just fine.
I forgot to mention that you have to delete the node_modules
before doing the steps above.
Hi again. Thanks for your help. In my opinion I do not have to install any packages on my system (only docker and docker-compose). On the other hand, I have just tried to install zenodo using docker (it also has a similar script with the command "npm update && npm install --silent -g node-sass@3.8.0 clean-css@3.4.19 uglify-js@2.7.3 requirejs@2.2.0") and it works perfectly (I tested with debian 9 and ubuntu 16.04).
Thanks again.
Docker version 17.12.0-ce Docker-compose version 1.8.1, build 878cff1
When I run the command "docker-compose build" I get an error on step 8:
(I tried three times and I got the same error every time)
Step 8/23 : RUN /tmp/setup-npm.sh ---> Running in 54c6e8872bbd /usr/bin/r.js -> /usr/lib/node_modules/requirejs/bin/r.js /usr/bin/r_js -> /usr/lib/node_modules/requirejs/bin/r.js /usr/bin/uglifyjs -> /usr/lib/node_modules/uglify-js/bin/uglifyjs /usr/bin/cleancss -> /usr/lib/node_modules/clean-css/bin/cleancss /usr/bin/node-sass -> /usr/lib/node_modules/node-sass/bin/node-sass /usr/lib/node_modules/node-sass/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js:375 exports.unique = (array, key) => { ^^ SyntaxError: Unexpected token => at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:413:25) at Object.Module._extensions..js (module.js:448:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/usr/lib/node_modules/node-sass/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5:14)
at Module._compile (module.js:430:26)
at Object.Module._extensions..js (module.js:448:10)
ERROR: Service 'static' failed to build: The command '/bin/sh -c /tmp/setup-npm.sh' returned a non-zero code: 1
Any idea? Thanks