Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 Assetic: Path to node executable could not be resolved

When running app/console assetic:dump, I am getting:

Path to node executable could not be resolved

What does it mean and how to fix this?

When trying to browse project via app_dev.php, I am getting an HTTP 500 errors when browser tries to download css and js files.

like image 772
Serhii Smirnov Avatar asked Mar 05 '14 12:03

Serhii Smirnov


People also ask

What is the path of Node executable?

Node. js provides a CLI which is an executable file called node . This executable file is located in folder /usr/local/bin .

Where is node JS path Mac?

If you downloaded and run, the installer package from the nodejs.org website, the Node. js main executables files -- node and npm -- are located on the /usr/local/bin folder.


2 Answers

First make sure you have node installed and find the path to node. You can usually find this by using which node which will return something like /usr/local/bin/node. If it returns something like /usr/bin/which: no node in ... you need to install node.

Next configure symfony. Open your config.yml (./app/config/config.yml) and the path to node to you assetic config, i.e.:

# app/config/config.yml
assetic:
    node: /usr/local/bin/node
like image 177
TheDevilOnLine Avatar answered Sep 20 '22 04:09

TheDevilOnLine


This worked for me

sudo apt-get remove nodejs
sudo apt-get remove npm

sudo curl -sL https://deb.nodesource.com/setup | sudo bash -

sudo apt-get install nodejs
like image 43
costa Avatar answered Sep 21 '22 04:09

costa