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 shrinkwrap
npm-shrinkwrap.json
so that you lockbabylon
to a working version (I found 6.3.26 to work). For example, by changing all instances ofbabylon
requires to something like this:node_modules
foldernpm install
Now 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!