0

I'm new to CodeceptJs and have a question regarding its installation.

I see 2 kinds of installation:

  1. local (npm install --save-dev codeceptjs)
  2. global ([sudo] npm install -g codeceptjs webdriverio)

When should I use local and when should I use global?

I also will have to integrate it with Jenkins pipeline in the future.If I perform global installation, then won't node_modules folder be installed in my machine? So I won't be able to integrate it with Jenkins rt?

I'm guessing, going with local installation is the appropriate solution?

Cathy 007
  • 41
  • 8

2 Answers2

0

You should make it as project's dependency via npm install --save-dev codeceptjs, then you can see it in project's package.json.

After you get the project source code form repo, switch into the folder where package.json inside, execute npm install which will install the dependencies declared in package.json as local package for project. Such procedure is also suite for CI by Jenkins.

We shouldn't install global package on Jenkins slave machine which will pollute a clean working environment on slave machine for other job's using, and global package can be overwrite when other users/jenkins jobs install same package with global style, this may lead you project fail due to incompatible package version.

For global install, most of time it's suite for you intend to do study or practice.

yong
  • 13,357
  • 1
  • 16
  • 27
0

please use localy and not global you can install codeceptjs locally and then to run use

npx codeceptjs run
Vitaly Menchikovsky
  • 7,684
  • 17
  • 57
  • 89