zenodo / zenodo

Research. Shared.
https://zenodo.org
GNU General Public License v2.0
920 stars 243 forks source link

NPM build install failed #2382

Open VlastaAIP opened 2 years ago

VlastaAIP commented 2 years ago

Browser & OS (see also https://www.whatismybrowser.com/): Ubuntu 22.04

Describe the bug

Installed Zenodo this way: https://github.com/zenodo/zenodo/blob/master/INSTALL.rst through Docker command: docker-compose -f docker-compose.full.yml build

In step 18/26 I get connection error with these information:

Writing /usr/local/var/instance/static/package.json
npm WARN deprecated angular-animate@1.4.14: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward.
npm WARN deprecated angular@1.4.14: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward.
npm WARN deprecated angular-sanitize@1.4.14: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward.
npm WARN deprecated ckeditor@4.5.11: We have renamed the @ckeditor package. New versions are available under the @ckeditor4 name.
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror git://github.com/webcanvas/angular-schema-form-ckeditor.git /root/.npm/_git-remotes/git-github-com-webcanvas-angular-schema-form-ckeditor-git-b213fa934759a18b1436e23bfcbd9f0f730f1296-b1e2a8ac: Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-webcanvas-angular-schema-form-ckeditor-git-b213fa934759a18b1436e23bfcbd9f0f730f1296-b1e2a8ac'...
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror git://github.com/webcanvas/angular-schema-form-ckeditor.git /root/.npm/_git-remotes/git-github-com-webcanvas-angular-schema-form-ckeditor-git-b213fa934759a18b1436e23bfcbd9f0f730f1296-b1e2a8ac: fatal: unable to connect to github.com:
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror git://github.com/webcanvas/angular-schema-form-ckeditor.git /root/.npm/_git-remotes/git-github-com-webcanvas-angular-schema-form-ckeditor-git-b213fa934759a18b1436e23bfcbd9f0f730f1296-b1e2a8ac: github.com[0: 140.82.121.4]: errno=Connection timed out
npm ERR! Linux 5.15.0-47-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code 128

npm ERR! Command failed: git clone --template=/root/.npm/_git-remotes/_templates --mirror git://github.com/webcanvas/angular-schema-form-ckeditor.git /root/.npm/_git-remotes/git-github-com-webcanvas-angular-schema-form-ckeditor-git-b213fa934759a18b1436e23bfcbd9f0f730f1296-b1e2a8ac
npm ERR! Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-webcanvas-angular-schema-form-ckeditor-git-b213fa934759a18b1436e23bfcbd9f0f730f1296-b1e2a8ac'...
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 140.82.121.4]: errno=Connection timed out
npm ERR! 
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/var/instance/static/npm-debug.log
The command '/bin/sh -c zenodo npm --pinned-file /code/zenodo/package.pinned.json     && cd ${INVENIO_INSTANCE_PATH}/static     && npm install     && cd /code/zenodo     && zenodo collect -v     && zenodo assets build' returned a non-zero code: 1
ERROR: Service 'static' failed to build : Build failed

Steps to Reproduce

git clone https://github.com/zenodo/zenodo.git cd ~/src/zenodo git checkout master docker-compose -f docker-compose.full.yml build docker-compose -f docker-compose.full.yml up -d

Expected behavior

I guess it is caused by adress git:// and it should be renamed to https:// (because I had same problem with other issue). But I don´t know where to change it, if it is somewhere inside the docker?

Screenshots (if applicable)

Additional context

VlastaAIP commented 2 years ago

I think I got it. This command actually helps: git config --global url."https://".insteadOf git://

Added to Dockerfile with: RUN git config --global url."https://".insteadOf git:// and also scripts/setup-npm.sh git config --global url."https://".insteadOf git://

RoHei commented 2 years ago

I think I got it. This command actually helps: git config --global url."https://".insteadOf git://

Added to Dockerfile with: RUN git config --global url."https://".insteadOf git:// and also scripts/setup-npm.sh git config --global url."https://".insteadOf git://

I run into the same bug and your fix worked - thanks a lot. :)

omaradam61 commented 1 year ago

where to put these lines please?. I mean inside of file the top or bottom or somewhere else.

rrotondo commented 1 year ago

Thank you @VlastaAIP for your hint. The problem is that github no longer accept unauthenticated protocol. @omaradam61 I just added RUN git config --global url."https://".insteadOf git:// in the dockerfile before the nvm install