Open poupotte opened 8 years ago
The bug is only for people on debian that have updated npm.
The workaround is to execute this command (as root):
echo 'prefix=/usr/local' > /usr/etc/npmrc
It will be fixed in the next debian package for cozy.
@nono would you mind post something on the forum, explaining this workaround, and its downsides? Thanks!
How is this workaround fixing the issue? cozy-controller is still installed on my other prefixed directory. Do I need to reinstall the cozy-controller after changing the prefix?
It's easier and safer to wait the next release of the debian package (in less than 2 weeks). It will fix this issue. But if you have the issue and want to fix it now, it's possible to use the workaround from above.
The npm from the officiel debian package is npm 1, with a patch to change its prefix to /usr/local
. So, packages installed as global (npm install -g
) went to /usr/local/lib/node_modules
. When npm2 is installed, it is not patched to use the same prefix. Its prefix is /usr
and it will search global packages in /usr/lib/node_modules
. As nothing were installed in this path, npm ls -g
says it's empty and npm update -g
will fail. The workaround is there to tell to npm2 to use the same prefix than npm1 and npm2 can then find the old packages and update them.
And what about using npm install -g cozy-controller
to install it in /usr/lib/node_modules
, so the next npm update -g
will just work ?
Also, this may also concern other globally installed packages, like cozy-monitor, or other applications the user may have installed.
A new version of the Controller has been published today (2.0.41). @bnjbvr reports that updating the stack from the home doesn't update the controller.
Here's the only error in the controller's logs: