2

I make new features as node modules.

 mkdir node_modules/some-feature
 cd node_modules/some-feature
 npm init

Of course, when I shrinkwrap, I get error messages like:

npm ERR! extraneous: some-feature@0.0.0 /myprojectdir/node_modules/some-feature

npm ERR! extraneous: something-else@0.0.0 /myprojectdir/node_modules/something-elsear

Is there a quick way to save the newly created extraneous packages to package.json?

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
  • [Is there a way to automatically build the package.json file for Node.js projects](http://stackoverflow.com/q/9961502/1700321) – Aleksandr M Feb 18 '15 at 12:53
  • @AleksandrM I'm aware of `npm init`, I mentioned it in the question you're replying to. It does not do what I'm asking. – mikemaccana Feb 18 '15 at 13:01
  • Yes, I know. Keep reading - http://stackoverflow.com/a/13381344/1700321 and http://stackoverflow.com/a/21123358/1700321. – Aleksandr M Feb 18 '15 at 13:03
  • 1
    Ah thanks @AleksandrM. The second link doesn't apply (install --save won't work for an original module that's already installed, it will just 404 and not modify package.json) but the script in the first link does. Feel free to add it as an answer. – mikemaccana Feb 18 '15 at 13:25

0 Answers0