nodejs / full-icu-npm

convenience loader for 'small-icu' node builds
https://nodejs.org/api/intl.html#intl_providing_icu_data_at_runtime
Other
152 stars 31 forks source link

Fix errors when installing `full-icu` with a project local .npmrc file #40

Closed dfrankland closed 5 years ago

dfrankland commented 5 years ago

.npmrc files are used to configure npm and can be set on a per-project basis: https://docs.npmjs.com/files/npmrc#per-project-config-file

On install, npm sets the INIT_CWD process variable to the original directory that ran npm install: https://docs.npmjs.com/cli/run-script

~Using INIT_CWD we can run the post install step in the correct directory.~ Installing the icu4c-data in INIT_CWD doesn't work since the path isn't relative to full-icu during install. Instead we link to the .npmrc locally during install and everything works out.

This is very useful for when folks use private registries.

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.

iamstarkov commented 5 years ago

latest yarn seems to solve it for me

dfrankland commented 5 years ago

True, it does seem to work no problem with yarn. I can't quite ask everyone at work to change to it though 😅

srl295 commented 5 years ago

@dfrankland i will take a look at this.

dfrankland commented 5 years ago

Here's a full reproduction showing this PR works to fix the problem described: https://github.com/dfrankland/full-icu-npm-npmrc-repro