reference
I am developing to be installed as a CLI executable. Therefore, I am packing it for use with NPM, and to install it.
Problem
However, as a CLI program, I want to write in a log file. This works fine on local installs, but certainly less accurate in a global installation: the program can be used as the Then, when a user tries to run the device, it fails due to I still ( Is there a way to authorize the NPM module to write in its own directory? What advice would you give me? I have thought about the following solutions: Is there any common thing to handle this kind of issue? No, allowing anyone to write in a directory globally installed node in their own directory There is no way. In fact, to allow a global setting, i.e. write to them According to Version 0.3, it is recommended to run NPM in the form of root. This NMM allows to change the user identifier in any Everyone This is a security feature that prevents any unauthorized post-install modifications in an installed module, making it trustworthy on the installed module. You should try to find a default location for your log, which is understandable in your business logic. User-overdrydable (through CII switches) would be good for global writing logs like / usr / local / lib / รข ?? | is placed in NPM, which has to be run
sudo to write there.
EACCES : The log folder and the files can not be created.
Steps taken
mkdir log and end log / exec .log ), but those files are then
any is not owned by, and can not be opened by the tool. The problem varies slightly but ends very soon.
Question
more specific questions
~ / .mytool / log , but I do not like all the user's files on all the spreading files on the machine .
chmod 666 global log file. Less ugly but unsafe
/ usr / local / lib , root via NPM via
sudo Can be run as. However, while doing so, the NPM will be:
any user before running any package build or test order.
nobody , and therefore can not override this setting.
~ / .yourTool / log , but does not extend node
~ , so cross-search - The platform seems to be a bit tricky to the global logging destination.
Comments
Post a Comment