Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrant setup fails: Failed to install node dependencies #310

Closed
andreasrosdal opened this issue May 19, 2020 · 4 comments
Closed

Vagrant setup fails: Failed to install node dependencies #310

andreasrosdal opened this issue May 19, 2020 · 4 comments

Comments

@andreasrosdal
Copy link
Contributor

Vagrant setup fails: Failed to install node dependencies.

default: Generated Ruleset manual files in /vagrant/freeciv-web/src/derived/webapp/man
default: Parsing /vagrant/freeciv/freeciv/common/networking/packets.def
default: Generated /vagrant/freeciv-web/src/derived/webapp/javascript/packhand_gen.js
default: Generated /vagrant/freeciv-web/src/derived/webapp/javascript/packets.js
default: Parsing /vagrant/freeciv/freeciv/common/events.h
default: Parsing /vagrant/freeciv/freeciv/common/events.c
default: Generated /vagrant/freeciv-web/src/derived/webapp/javascript/fc_events.js
default: Parsing /vagrant/freeciv/freeciv/data/helpdata.txt
default: Generated /vagrant/freeciv-web/src/derived/webapp/javascript/freeciv-helpdata.js
default: Parsing /vagrant/freeciv/freeciv/data/stdsounds.soundspec
default: Generated /vagrant/freeciv-web/src/derived/webapp/javascript/soundset_spec.js
default: Copied sounds to /vagrant/freeciv-web/src/derived/webapp/sounds
default: Copied scenarios to /var/lib/tomcat8/webapps/data/savegames
default: NOT updating files generated from external sources (e.g. wikipedia).
default:   Due to various risks of using external data, this is not the default behavior.
default:   To run these scripts, use:
default:       $ > UPDATE_EXTERNAL_SOURCES=true sync-js-hand.js
default: done with sync-js-hand!
default: npm
default:
default: ERR!
default:
default: code
default:  EPROTO
default: npm
default:
default: ERR!
default:
default: syscall
default:  symlink
default: npm
default:
default: ERR!
default:
default: path
default:  ../handlebars/bin/handlebars
default: npm
default:
default: ERR!
default:
default: dest
default:  /vagrant/freeciv-web/node_modules/.bin/handlebars
default: npm
default:
default: ERR!
default:
default: errno
default:  -71
default: npm
default:
default: ERR!
default:  EPROTO: protocol error, symlink '../handlebars/bin/handlebars' -> '/vagrant/freeciv-web/node_modules/.bin/handlebars'
default: npm
default:
default: ERR!
default:  A complete log of this run can be found in:
default: npm
default:
default: ERR!
default:      /home/vagrant/.npm/_logs/2020-05-19T19_21_06_958Z-debug.log
default:
default: ***********************************
default: Failed to install node dependencies
default: ***********************************

@lonemadmax has done some work on handlebars here, which seems relevant:
https://github.com/lonemadmax/freeciv-web/commits/movingborders

@lonemadmax
Copy link
Contributor

That's merged here, and it's probably the cause of the problem. Looks like an error attempting to create a symlink. Is this on a Windows machine?
From https://stackoverflow.com/questions/56729305/npm-err-eproto-protocol-error-symlink-babel-parser-bin-babel-parser-js it seems adding --no-bin-links to the npm command might solve it or break it even more, I don't know if that would put the files where we later go to fetch them. Another solution mentioned is to run the vagrant command as administrator, which of course one may not want to do. Or maybe you should revert my changes and go back to manually including the handlebars runtime in the repo.

@andreasrosdal
Copy link
Contributor Author

Yes, this is Windows.

I added this in install.sh:
npm config set cache /tmp/.npm-cache
cd "${basedir}"/freeciv-web &&
npm install --no-bin-links ||
handle_error 8 "Failed to install node dependencies"

Now, I get this error message:
default: at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
default: at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
default: at java.lang.reflect.Method.invoke (Method.java:498)
default: at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
default: at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
default: at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
default: at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
default: [INFO] ------------------------------------------------------------------------
default: [INFO] BUILD FAILURE
default: [INFO] ------------------------------------------------------------------------
default: [INFO] Total time: 32.691 s
default: [INFO] Finished at: 2020-05-23T13:27:18Z
default: [INFO] ------------------------------------------------------------------------
default: [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (Precompile Handlebars templates) on project freeciv-web: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
default: [ERROR]
default: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
default: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
default: [ERROR]
default: [ERROR] For more information about the errors and possible solutions, please read the following articles:
default: [ERROR] [Help 1] https://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
default:
default: **********************************
default: Failed to build freeciv-web server
default: **********************************

@andreasrosdal
Copy link
Contributor Author

Added a workaround here: 9a8a6cb

On Windows, Vagrant must be run on a command prompt with administator access.

@vliegnaarbeer
Copy link

I'm running "vagrant up" on command prompt with Admin access on Windows 10, and also see this same issue. I just pulled fresh from develop branch.

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

No branches or pull requests

3 participants