So yesterday I attended the Build Actions for Your Community (Actions on Google) Workshop. It was an opportunity to learn how to develop Actions for Google Assistant (the voice assistant available for users of Google Home, or Google Assistant in a Mobile device). The workshop was brilliant and I learnt a lot, and there were plenty of mentors on hand to help guide you and keep you motivated.
I managed to complete CodeLab Level 1 last night and attempted to start CodeLab level 2, but was hitting an issue when trying to install the required Firebase tools on my laptop.
The issue was around npm not being able to find the module ‘internal/util/types’ when trying to install the firebase tools with the command npm -g install firebase-tools
FULL ERROR MESSAGE:
Darwin 17.5.0
npm ERR! argv “/usr/local/Cellar/node/10.7.0/bin/node” “/usr/local/bin/npm” “i” “-g” “npm”
npm ERR! node v10.7.0
npm ERR! npm v2.14.7
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module ‘internal/util/types’
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:
After spending hours of faffing around trying to work out a solution, today I finally fixed it with the following:
sudo rm -rf /usr/local/lib/node_modules
brew update node
I then ran the firebase tools install command again:
npm -g install firebase-tools
Which produced the following output:
/usr/local/bin/firebase -> /usr/local/lib/node_modules/firebase-tools/bin/firebase
> @google-cloud/functions-emulator@1.0.0-beta.5 postinstall /usr/local/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator
> node scripts/upgrade-warning
If you’re using the Emulator via the Firebase CLI, you can
disregard this message.
If you’re upgrading @google-cloud/functions-emulator, these
are the recommended upgrade steps:
1. Stop the currently running emulator, if any:
functions stop
2. Uninstall the current emulator, if any:
npm uninstall -g @google-cloud/functions-emulator
3. Install the new version of the emulator:
npm install -g @google-cloud/functions-emulator
If you have trouble after upgrading, try deleting the config
directory found in:
~/.config/configstore/@google-cloud/functions-emulator
Then restart the emulator. You can also check for any renegade
Node.js emulator processes that may need to be killed:
ps aux | grep node
+ firebase-tools@4.0.2
added 547 packages from 274 contributors in 16.264s
It worked 🙂
Thank the lord!
Looking forward to completing Codelab Level 2 now.
Good luck everyone 🙂