Describe the bug
Error: Cannot find module ‘uuid/v4’
To Reproduce
- Write the script below in “Pre-request Script”:
uuidv4 = require(‘uuid/v4’);
pm.globals.set(‘uuid’, uuidv4()); - Use the globals variable - “uuid” in request body.
- Click “Send” to send a POST request.
Expected behavior
Generate a version 4 uuid before sending request.
Screenshots
App information
- Postman Version: 7.5.0
- OS: Windows 10 Enterprise 1809
Additional context
It works fine if I rewrite the script as below:
uuid = require(‘uuid’);
pm.globals.set(‘uuid’, uuid.v4());
But it should be deprecate according to the link: https://www.npmjs.com/package/uuid