Search code examples
javascriptnode.jsui-testingcodeceptjs

Codeceptjs only works when installed globally


When I open the instructions to install CodeceptJS it offers the option to install the node_module both locally and globally. However only global install works. When I install codeceptjs locally in my express application then try to initialize the codecept install I get "bash: codeceptjs: command not found". Any ideas?

nodejs - v6.2.2, express - v4.13.4, using a mac


Solution

  • If you install it locally, most likely it's not in your $PATH. You need to specify the full path to it. Assuming you're in the root of your project, type: ./node_modules/.bin/codeceptjs

    Or you can re-export the PATH variable to include this path (unadvised).