Home > Software engineering >  command not found: mssql on macOS
command not found: mssql on macOS

Time:10-29

I installed mssql using

npm install -g sql-cli

and it was installed succesfully.

The output after insallation:
`npm WARN deprecated [email protected]: The sprintf package is deprecated in favor of sprintf-js. npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. /usr/local/Cellar/heroku-node/12.21.0/bin/mssql -> /usr/local/Cellar/heroku-node/12.21.0/lib/node_modules/sql-cli/bin/mssql

However, when I try to run

mssql -u sa -p myPassw0rd

I get an error that says command not found: mssql on macOS

I also made sure that /usr/local/Cellar/heroku-node/12.21.0/lib/node_modules/sql-cli/bin/mssql is in my $PATH variable

What is the solution to this issue?


I am using

  • npm v6.14.10
  • node v12.21.0
  • macOS Bug Sur 11.6

CodePudding user response:

When adding sql-cli your path, make sure to add the directory containing the executable rather than the executable itself.

In your case, add /usr/local/Cellar/heroku-node/12.21.0/lib/node_modules/sql-cli/bin to your path, rather than /usr/local/Cellar/heroku-node/12.21.0/lib/node_modules/sql-cli/bin/mssql.

  • Related