Closed MichaelGatesDev closed 3 years ago
I believe the project already behaves as you propose, since as the corresponding documentation states, the default value of NPM_BIN_PATH
is npm
.
Following the principle of "explicit is better than implicit", I don't think Django-Tailwind should do any more than it currently does to locate the NPM executable. As noted in the above documentation, if Django-Tailwind can't find the executable, instructions are clearly provided regarding how to specify the desired executable. (And there can often be multiple NPM executables on a system, ergo why being explicit is preferred.)
@MichaelGatesDev you can change npm
bin path as stated in the docs. Please see a link in James' comment above.
I am just getting started with django-tailwind and I received the following error:
The error makes it seem like the app tried to find a path to NPM or actually tried to use it. But according to this file, it will only ever be retrieved from a django settings file.
I think that it is quite likely that a user's system has NPM installed globally, so if a user does not explicitly set
NPM_BIN_PATH
, it should just assume thatnpm
is available globally and should attempt to run the subprocess assubprocess.run(["npm"] + list(args), cwd=self.cwd)
(how to run npm in subprocess without an absolute path to the executable).