babel: Modules depending on Babylon cannot be Browserified, failing with "Cannot find module './parser'" (T6930)
Issue originally made by Kawahara Eiji (syuilo)
Bug information
- Babel version: 6.3.13
- Node version: 5.3.0
- npm version: 3.3.12
Options
I try to build my project, the following error occurs.
Error: Cannot find module './parser' from 'C:\Users\syuilo\Desktop\Misskey\Misskey-Web\node_modules\babylon'
Sorry my English. thanks.
Description
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 29
The workaround I’m using is npm shrinkwrap:
npm shrinkwrapnpm-shrinkwrap.jsonso that you lockbabylonto a working version (I found 6.3.26 to work). For example, by changing all instances ofbabylonrequires to something like this:node_modulesfoldernpm installNow you should have a locked version of babylon at 6.3.26 no matter how deep the dependency goes.
Note that you’re messing with the expected versions deep in your require tree - this could have unexpected consequences!