简体   繁体   中英

Node error on aws ubuntu but not OSX

I have a project written using Express/Node and it runs locally on OSX just fine. However, when I cloned it to an aws EC2 instance running Ubuntu, I get this error:

events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT

When I open the public DNS in a browser. The html is served, but nothing in my public directory is being served with it. Even when I go to the files directly (eg ./css/style.css).

It must be a difference between Node on Ubuntu and Node on OSX? The error message isn't detailed enough to know what's going wrong...

Thanks for any help!

run the command npm rebuild at the Ubuntu server. This is probably caused by the binary files used in OSX. They're different at Ubuntu.

After two days, I finally found it. The express generator set up the project with a sass compiler, which requires Ruby and the Sass gem, which the aws Ubuntu distro didn't have. Thanks for helping me with this, everyone. I wish the error messages in node were a bit more helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM