While attempting to get Shifter to work on my laptop I ran into the following error. The fix is below.
When doing anything Shifter related I was getting the below.
TypeError: Object #<Queue> has no method ‘replace’
at Object.buildJS [as js] (/usr/local/lib/node_modules/shifter/lib/module.js:324:11)
at CB (/usr/local/lib/node_modules/shifter/node_modules/rimraf/rimraf.js:42:5)
at Object.oncomplete (fs.js:97:15)
Googling that error led me to https://github.com/yui/shifter/pull/111. That explains the problem but how exactly do I fix it… Just making that file change on its own doesn’t do anything… Making the change then re-installing Shifter just resets that file… After some trial and error I fixed it like this.
- Find Shifter’s package.json. For me its at /usr/local/lib/node_modules/shifter. If you aren’t sure where it is, note that the path is in the error message 😉
- Change the required gear version as shown in the commit of that github pull https://github.com/yui/shifter/pull/111/files
- In the Shifter directory run npm update
- Get on with the actual work that you are meant to be doing.