node-config icon indicating copy to clipboard operation
node-config copied to clipboard

Error: Cannot find module on starting app(v1.11.0)

Open fuzzy31u opened this issue 11 years ago • 2 comments

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.

fuzzy31u avatar Feb 13 '15 10:02 fuzzy31u

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.

lorenwest avatar Feb 13 '15 17:02 lorenwest

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,

fuzzy31u avatar Feb 14 '15 07:02 fuzzy31u