cfpb / generator-cf

Yeoman generator for Capital Framework
http://cfpb.github.io/capital-framework/getting-started/
Creative Commons Zero v1.0 Universal
9 stars 13 forks source link

Add an .npmrc file #113

Closed ascott1 closed 8 years ago

ascott1 commented 8 years ago

Idea from https://blog.heroku.com/archives/2015/11/10/node-habits-2016#2-use-a-smart-npmrc

We could add a "smart" .npmrc file that will automatically enforce --save-exact.

Scotchester commented 8 years ago

Seems like a good idea :+1:

Wouldn't mind exploring shrinkwrapping further, too.

JeffreyMFarley commented 8 years ago

FYI: I followed the instructions here and I had the script fail after the yo "interview"

✔ Done in _cache
/Users/farleyj/homebrew/lib/node_modules/generator-cf/node_modules/yeoman-generator/lib/actions/actions.js:191
    throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e.code + ').');
    ^

Error: Unable to read "/Users/farleyj/homebrew/lib/node_modules/generator-cf/app/templates/.npmrc" file (Error code: ENOENT).
    at read (/Users/farleyj/homebrew/lib/node_modules/generator-cf/node_modules/y

I fixed it by manually downloading the .npmrc file from this repository and placing it in the appropriate spot.

Thought you should know that the npm package does not have quite everything

Scotchester commented 8 years ago

@JeffreyMFarley Thanks for the note, Jeff!

I bet we're getting bit by this:

NOTE: Because local (per-project or per-user) .npmrc files can contain sensitive credentials, they must be readable and writable only by your user account (i.e. must have a mode of 0600), otherwise they will be ignored by npm!

npmrc docs, https://docs.npmjs.com/files/npmrc

/cc @contolini