I
I
Ilvir Akhunov2019-08-07 11:13:20
Software testing
Ilvir Akhunov, 2019-08-07 11:13:20

How to properly import modules in newman?

I run postman tests through gitlab with newman and get Error: Cannot find module '/opt/dbo/node/newman/node_modules/ajv' and Error: Cannot find module 'ajv'. Ajv are in the node_modules folder on the server.
In tests I import var Ajv = require('ajv') or var Ajv = require('/opt/dbo/node/newman/node_modules/ajv') (absolute path). What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KiT, 2019-08-14
Maverick @kit_de

npm i in the job do
or the path is relative.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question