question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not update Website_Theme, Missing Node...

See original GitHub issue

Description of the issue

Node.js problems to perform style generation. Edit, update or create a website theme style is not working. FileNotFound: [Error2] No such file or directory ‘node’:‘node’

Context information (for bug reports)

frappe_docker installed version12 New site install

Steps to reproduce the issue

  1. Use a clean frappe_docker setup
  2. Create new site
  3. Go to Website module, and edit standard theme. Save changes. Or create new theme and try to save changes.

image

Observed result RIGHT IMAGE

Message error: Node not found. Some tools running on node might not be working.

Expected result LEFT IMAGE

Changes are saved as in a bench install without docker.

Stacktrace / full error message if available

Log from <project>_erpnext-python_1 container

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
    doc.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 273, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 296, in _save
    self.insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 230, in insert
    self.run_before_save_methods()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 893, in run_before_save_methods
    self.run_method("validate")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 794, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1064, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1047, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 788, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_theme/website_theme.py", line 13, in validate
    self.validate_theme()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_theme/website_theme.py", line 43, in validate_theme
    self.generate_bootstrap_theme()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_theme/website_theme.py", line 66, in generate_bootstrap_theme
    process = Popen(command, cwd=frappe.get_app_path('frappe', '..'), stdout=PIPE, stderr=PIPE)
  File "/opt/bitnami/python/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/opt/bitnami/python/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'node': 'node'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15

github_iconTop GitHub Comments

2reactions
ashish-greycubecommented, Jun 25, 2022

This happens when node is installed via nvm

Check $ /usr/bin/node Gives output : -bash: /usr/bin/node: No such file or directory It should give:

Welcome to Node.js v14.19.0.
Type ".help" for more information.
> 

Solution: Make a symbolic link $ sudo ln -s $(which node) /usr/bin/

1reaction
revantcommented, Sep 2, 2020

I think you’re right.

yarn add node-sass only happens in frappe-nginx

I sent a pr to frappe https://github.com/frappe/frappe/pull/11220

Generally in nodejs projects node-sass happens in development and only css assets are packed and served in production. In frappe theme changes happen with node-sass in production.

snyk shows there are security issues in node-sass to be kept in production.

@MarekPikula send a PR here that adds node-sass even in erpnext-nginx I’ll merge.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to change website theme and save this theme so it ...
and when i refresh the page the theme doesn't reset. I was wondering how can i do that , or can someone put...
Read more >
Themes disabled during update
I've noticed sometimes when viewing the themes selection page that all the themes are disabled even the default theme when several themes ...
Read more >
theming - Node form – self changing theme - Drupal Answers
What is disturbing.. it changes theme from admin to regular. Instead of Seven Theme I see regular website theme. Am I missing some...
Read more >
[Solved] New v12 install cannot get to login screen
Ok, so today I finally got a successful install using the easy install method described here: However, when I attempt to get to...
Read more >
HubSpot CMS for Developers Local Issues
... and run "npx /create-cms-project test-theme", the cloning always fails and the. ... If you success installing Node.js then type next command and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found