Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku log warning "(node) sys is deprecated. Use util instead" when script runs

I have deployed a node script in heroku to be run by a scheduler. But when the script runs I see a warning in the logs.

Dec 07 11:01:10 xxx heroku/scheduler.3255 Starting process with command `node bin/script` 
Dec 07 11:01:13 xxx app/scheduler.3255:  (node) sys is deprecated. Use util instead. 

I have not declared a engine section in my package.json.

Is a problem with the node version? How can I avoid this warning?

Thanks!

like image 806
ezain Avatar asked Dec 08 '15 16:12

ezain


People also ask

How to check error logs in Heroku?

Try logging into your Heroku account and then select your application and finally click on view logs. and check the logs that will help you to figure your mistake Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research!

How to fix Heroku app not responding?

Try logging into your Heroku account and then select your application and finally click on view logs. and check the logs that will help you to figure your mistake

How does Heroku connect work with logplex?

Heroku Connect emits log messages to Logplex making them available to your application via the CLI or using logging add-ons. Log entries follow the standard log format with a source of app, a dyno of herokuconnect and a message that contains structured data including standard fields such as event and level.

How do I deploy a node-modules project to Heroku?

My guess is you deploy the content of your node-modules project folder with a bcrypt package that do not work on Heroku. You should add the node-modules folder in your .gitignore and just deploy the package.json file on the server, as this answer suggests.


1 Answers

This is happening because (obviously) 'sys' has been deprecated and replaced by 'util'.

If you are not using 'sys' directly (search your codebase for something like require('sys') ) then one of the modules that you depend on (or its dependencies) might be.

To find the offending module do an npm install on your project and then grep for require('sys') (or with double quotes) to see if you can find the module. Example grep command:

grep -r "require('sys')" .

If you really want that warning to go away and it's in a dependency or sub-dependency then you have a couple of choices:

  1. Replace the module that's using sys with one that isn't yet provides the same functionality. (Check that there isn't a more recent version of the module that's addressed this issue.)
  2. Submit a Pull Request fixing the issue in the module.
like image 172
Guy Avatar answered Oct 26 '22 01:10

Guy