kevin1024/django-npm

Error fresh out of the box with Python 3.6

Closed this issue · 2 comments

I ran through the steps exactly and got this error.

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/patrick/JMS2Env/lib/python3.6/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/home/patrick/JMS2Env/lib/python3.6/site-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/patrick/JMS2Env/lib/python3.6/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/patrick/JMS2Env/lib/python3.6/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/home/patrick/JMS2Env/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 176, in handle
    collected = self.collect()
  File "/home/patrick/JMS2Env/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 97, in collect
    for finder in get_finders():
  File "/home/patrick/JMS2Env/lib/python3.6/site-packages/django/contrib/staticfiles/finders.py", line 264, in get_finders
    yield get_finder(finder_path)
  File "/home/patrick/JMS2Env/lib/python3.6/site-packages/django/contrib/staticfiles/finders.py", line 277, in get_finder
    return Finder()
  File "/home/patrick/JMS2Env/lib/python3.6/site-packages/npm/finders.py", line 76, in __init__
    self.locations = [(self.destination, os.path.join(self.node_modules_path, 'node_modules'))]
  File "/home/patrick/JMS2Env/lib/python3.6/posixpath.py", line 78, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not Path

I should note that I was able to fix it by changing line 76 in finders.py to

self.locations = [(self.destination, os.path.join(str(self.node_modules_path), 'node_modules'))]

I am also using 3.6, but I have not encountered this error. I made it through all steps under Installation.

Python 3.6.2

Thanks for the update. I suspect a configuration error, feel free tout reopen if this error comes back!