Getting Error:Cannot find package '@ssp-team-1861/functions even though the script line has been auto written in the script. At start, it worked fine. After some hours , getting this error for the same script
After restarting the postman, I can able to use the package by using it as
const functions = pm.require(‘@ssp-team-1861/functions’);
Before the mentioned, I used the package syntax as let packageId = pm.collectionVaraibles.get(“packageId“);pm.require(packageId);
Now it’s not working like that
Glad to see you have it working again! ![]()
Was the Collection Variable value “@ssp-team-1861/functions”?
This would be the method that I would have used to access the different functions of the script:
const variableName = pm.require('@team-domain/package-name');
variableName.functionName()
The collection may be used in some other accounts/workspace also. So, for that I created a variable named packageId with value “@team-domain/package-name“. And in pre/post script, I will declare it as
const variableName = pm.require(pm.collectionvariables.get(“packageId“));
In this case, it worked for some requests initially. But now getting the error “Error: Cannot find package ‘@namespaceID/functions“
It will only work in the team that the package library is part of and not across accounts.
Is this working everywhere, when you use this syntax at the top of the script?
const variableName = pm.require('@team-domain/package-name');
variableName.functionName()
If it does, I would recommend using it over trying to create a different variable for this package.