Error: Cannot find module on starting app(v1.11.0)
Hello,
I did npm install config and create config dir, default.json following Quick Start(https://www.npmjs.com/package/config),
but I got errors on gulp starting app,
Error: Cannot find module 'js-yaml' from '/path/to/node_modules/config/lib Error: Cannot find module 'yaml' from '/path/to/node_modules/config/lib Error: Cannot find module 'json5' from '/path/to/node_modules/config/lib Error: Cannot find module 'hjson' from '/path/to/node_modules/config/lib Error: Cannot find module 'toml' from '/path/to/node_modules/config/lib Error: Cannot find module 'cson' from '/path/to/node_modules/config/lib Error: Cannot find module 'properties' from '/path/to/node_modules/config/lib Error: Cannot find module 'coffee-script' from '/path/to/node_modules/config/lib Error: Cannot find module 'iced-coffee-script' from '/path/to/node_modules/config/lib
So I did
$ cd node_modules/config/ $ npm install
Then gulp again, but still got these errors,
Error: Cannot find module 'iced-coffee-script' from '/path/to/node_modules/config/lib Error: Cannot find module 'yaml' from '/path/to/node_modules/config/lib
Now I did
$ npm install yaml iced-coffee-script
but in this time,
/path/to/node_modules/gulp-sourcemaps/node_modules/convert-source-map/index.js:109 var m = content.match(commentRx); ^ RangeError: Maximum call stack size exceeded
How do I resolve this error?
Thank you.
It appears that gulp is wanting to have packages listed in devDependencies installed. Node-config doesn't need these packages except for testing (or if you're actually using those formats in your app).
You may need to speak with someone familiar with gulp, as it sounds like it's being too aggressive in requiring dependencies, and it sounds like it's triggering a bug when doing something it calls convert-source-map.
This isn't a node-config issue, but I'd be interested in hearing the outcome of your investigation for other users of node-config that may be using gulp.
Sorry I should write with browserify and gulp, and this issue helps me.
https://github.com/lorenwest/node-config/issues/152
ignoreMissing: true for browserify,
Thank you for your reply.
Regards,