Browse Source

Add workaround for ethercalc bug

There is a bug with global npm installs[1] which causes node to be
unable to find the SocialCalc.js module. We can work around it by
symlinking the socialcalc module into the location that node expects to
find it[2].

[1] https://github.com/audreyt/ethercalc/issues/542
[2] https://github.com/audreyt/ethercalc/issues/542#issuecomment-330039410

Change-Id: I6f751c19c772cda74f5a7b601238b4519039d257
Colleen Murphy 9 months ago
parent
commit
23a6360c25
1 changed files with 14 additions and 0 deletions
  1. 14
    0
      manifests/init.pp

+ 14
- 0
manifests/init.pp View File

@@ -103,6 +103,20 @@ class ethercalc (
103 103
     require => Anchor['nodejs-package-install'],
104 104
   }
105 105
 
106
+  # NOTE(cmurphy) Workaround global install issue
107
+  # https://github.com/audreyt/ethercalc/issues/542
108
+  if ($use_nodejs_version == '6.x') {
109
+    file { "${base_install_dir}/node_modules/ethercalc/node_modules":
110
+      ensure  => directory,
111
+      require => [File[$base_install_dir], Exec['install-ethercalc']],
112
+    }
113
+    file { "${base_install_dir}/node_modules/ethercalc/node_modules/socialcalc":
114
+      ensure  => link,
115
+      target  => "${base_install_dir}/node_modules/socialcalc",
116
+      require => File["${base_install_dir}/node_modules/ethercalc/node_modules"],
117
+    }
118
+  }
119
+
106 120
   # TODO(ianw): remove this when trusty is dropped
107 121
   if $use_upstart {
108 122
 

Loading…
Cancel
Save