Newman: ReferenceError: pm is not defined - postman

Hi I could use pm in my Postman (Standalone). The code was something like:
let someData = pm.response.json().data;
But when I ran a similar script run in Newman, I got this error:
ReferenceError: pm is not defined
According to this discussion, Newman since 3.6.0 should support pm, and I was using 4.2.3. What did I miss?

Related

ng build --prod - Error: Property body expected type of array but got null

I recently made a new branch in my angular project and am working on in for a bit. Now I wanted to build it for testing on smartphones. When using ng build --prod, I get the following error (ng build works tho!)
An unhandled exception occurred:
/Users/r/Documents/.../project/main-es2015.23a6f948094203a25f4a.js:
Property body expected type of array but got null See
"/private/var/folders/c5/y_n4tj316sq9x1nqx20qdlh40000gp/T/ng-FBFvv4/angular-errors.log"
for further details.
The angular-errors.log is not helpfull at all:
[error] TypeError:
/Users/r/Documents/.../project/main-es2015.23a6f948094203a25f4a.js:
Property body expected type of array but got null
at validate (/Users/r/Documents/.../project/node_modules/#babel/types/lib/definitions/utils.js:160:13)
at Object.validate (/Users/r/Documents/.../project/node_modules/#babel/types/lib/definitions/utils.js:229:7)
at validateField (/Users/r/Documents/.../project/node_modules/#babel/types/lib/validators/validate.js:24:9)
at Object.validate (/Users/r/Documents/.../project/node_modules/#babel/types/lib/validators/validate.js:17:3)
at NodePath._replaceWith (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/replacement.js:172:7)
at NodePath._remove (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/removal.js:57:10)
at NodePath.remove (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/removal.js:36:8)
at PluginPass.ForOfStatement (/Users/r/Documents/.../project/node_modules/#babel/plugin-transform-for-of/lib/index.js:206:16)
at newFn (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/visitors.js:175:21)
at NodePath._call (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/context.js:55:20)
at NodePath.call (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/context.js:42:17)
at NodePath.visit (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/context.js:92:31)
at TraversalContext.visitQueue (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/context.js:116:16)
at TraversalContext.visitSingle (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/context.js:88:19)
at TraversalContext.visit (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/context.js:144:19)
at Function.traverse.node (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/index.js:82:17)
Production Environment.prod.ts looks like this:
export const environment = {
production: true,
VERSION: require('../../package.json').version
};
I tried using the --source-map=true flag, but it is canceling building before its able to write the sourcemap.
I didnt put hands on my package.json since two month, but also tried deleting the node_modules and reinstall them.
I also tried changing rxjs and typescript versions, but no success
Im using angular -v 10.1.6, typescript -v 4.0.3, rxjs -v 6.4.5
What can I do??
Any help appreaciated!
I found a solution here https://github.com/angular/angular-cli/issues/16998.
My problem was using Labels. It appears that babel is having a bug with that.

Google Cloud TypeError: Cannot read property 'Reader' of undefined

My Google Cloud Function won't upload if I include this line, which came from the docs:
const {Translate} = require('#google-cloud/translate').v2;
The error is
TypeError: Cannot read property 'Reader' of undefined
There's no Reader in my code.
My version is:
npm -v #google-cloud/translate
6.14.10
Which is odd, because the current npm version is 6.0.5, and the release notes say there hasn't been an update since March 2020.
I tried both Node 10 and Node 12 for the Firebase Cloud Functions engine, same error.
Am I getting this error because I'm on the event horizon of a black hole and downloaded a future version of #google-cloud/translate? I think I might be in an alternative universe, 2020 was awful. How are things in your universe?
I updated the npm modules in my /functions directory and the error message is gone. Both firebase-functions and #google-cloud/translate were out of date.

Running Clojure 1.9.0 on Windows redux

Last month I asked this question about how to get the latest version of Clojure to run on Windows. #cfrick was kind enough to provide some guidance, but after following his suggestion and monkeying with it for a while now I'm still unable to get Clojure 1.9.0 to run on Windows. I know I must be doing something stupid, but here's what I've got:
I downloaded all the 1.9.0 jars from clojure.org and put them in a directory, along with the core.specs.alpha and spec.alpha jars:
01/12/2018 10:34 PM <DIR> .
01/12/2018 10:34 PM <DIR> ..
12/14/2017 05:55 PM 3,688,794 clojure-1.9.0.jar
12/14/2017 05:55 PM 2,816,528 clojure-1.9.0-javadoc.jar
12/14/2017 05:55 PM 1,052,237 clojure-1.9.0-slim.jar
12/14/2017 05:55 PM 606,466 clojure-1.9.0-sources.jar
01/12/2018 03:43 PM 4,236 core.specs.alpha-0.1.24.jar
01/12/2018 03:42 PM 591,287 spec.alpha-0.1.143.jar
I then tried the command line #cfrick suggested, substituting in the up-to-date version numbers of the specs.alpha and core.specs.alpha jars:
java -cp clojure-1.9.0.jar:spec.alpha-0.1.143.jar:core.specs.alpha-0.1.24.jar clojure.main
Unfortunately, this produces the following error message:
Error: Could not find or load main class clojure.main
That's all that it dumps, so at least that's an improvement over the long list of errors it threw when it couldn't find core.specs.alpha and spec.alpha. :-)
So I dug out the jar utility, dumped the contents of clojure-1.9.0.jar into a file, and found that the class clojure/main.class exists in the jar. I tried re-running the java command above specifying the class name as clojure/main instead of clojure.main but got exactly the same error, so I guess there's no difference between . and / in the class name.
Just for fun (?) I tried running it using clojure-1.9.0-slim.jar but got the same error. I also tried surrounding the specified class path in double quotes, just to try something else, but got the same results. I also tried fully-qualifying the names of the .jar files with the directory in which they reside, appropriately double-quoted - still, same error.
I'd appreciate further guidance on how to get Clojure 1.9.0 to run from the command line, without using something like Leiningen or Boot.
Instead of : use ; as the class path separator:
java -cp clojure-1.9.0.jar;spec.alpha-0.1.143.jar;core.specs.alpha-0.1.24.jar clojure.main
The answer is to install Boot or Lein, really you're not going to get far without those.

JSPM and testbench and unexplainable "testing.js" output

We have been pulling our hair for a few days and can't really seem to get a hold of the actual problem. We wanted to create a testbench, to increase our code coverage but this proved to be not so easy as anticipated.
After including the correct zone files, we found, by looking at the QuickStart from angular, that we needed to call TestBed.initTestEnvironment. Which needs to parameters, which we imported:
import * as browserTesting from '#angular/platform-browser-dynamic/testing';
TestBed.initTestEnvironment(
browserTesting.BrowserDynamicTestingModule,
browserTesting.platformBrowserDynamicTesting()
);
However, as soon as we try and run this via Karma (with jasmine) we run into a 404:
Running "karma:single" (karma) task
Verifying property karma.single exists in config...OK
File: [no files]
Options: background=false, client={}
20 12 2016 13:22:25.757:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
20 12 2016 13:22:25.764:INFO [launcher]: Starting browser Chrome
20 12 2016 13:22:26.439:INFO [Chrome 54.0.2840 (Linux 0.0.0)]: Connected on socket cuixl-0soveFUA_PAAAA with id 58970475
20 12 2016 13:22:26.711:WARN [web-server]: 404: /base/jspm_packages/npm/#angular/compiler#2.3.0/bundles/compiler-testing.umd.js/index.js
20 12 2016 13:22:26.713:WARN [web-server]: 404: /base/jspm_packages/npm/#angular/core#2.3.0/bundles/core-testing.umd.js/index.js
20 12 2016 13:22:26.714:WARN [web-server]: 404: /base/jspm_packages/npm/#angular/platform-browser#2.3.0/bundles/platform-browser-testing.umd.js/index.js
Chrome 54.0.2840 (Linux 0.0.0) ERROR
Error: (SystemJS) XHR error (404 Not Found) loading /home/arend/Documents/Projects/Barco/opspace/barco-opspace/jspm_packages/npm/#angular/compiler#2.3.0/bundles/compiler-testing.umd.js/index.js
Error: XHR error (404 Not Found) loading /home/arend/Documents/Projects/Barco/opspace/barco-opspace/jspm_packages/npm/#angular/compiler#2.3.0/bundles/compiler-testing.umd.js/index.js
at XMLHttpRequest.wrapFn [as _onreadystatechange] (/home/arend/Documents/Projects/Barco/opspace/barco-opspace/jspm_packages/npm/zone.js#0.7.2/dist/zone.js:729:25) [<root>]
at Zone.runTask (/home/arend/Documents/Projects/Barco/opspace/barco-opspace/jspm_packages/npm/zone.js#0.7.2/dist/zone.js:135:41) [<root> => <root>]
at XMLHttpRequest.ZoneTask.invoke (/home/arend/Documents/Projects/Barco/opspace/barco-opspace/jspm_packages/npm/zone.js#0.7.2/dist/zone.js:285:27) [<root>]
Error loading /home/arend/Documents/Projects/Barco/opspace/barco-opspace/jspm_packages/npm/#angular/compiler#2.3.0/bundles/compiler-testing.umd.js/index.js as "./bundles/compiler-testing.umd.js/index" from /home/arend/Documents/Projects/Barco/opspace/barco-opspace/jspm_packages/npm/#angular/compiler#2.3.0/testing.js
looking at "jspm_packages/npm/#angular/compiler#2.3.0/testing.js", we quickly found that it held the wrong information:
module.exports = require('./bundles/compiler-testing.umd.js/index');
instead of the expected:
module.exports = require('./bundles/compiler-testing.umd');
If I manually correct this, all works perfectly. So my question:
How do we prevent JSPM or anyone from generating a wrong testing.js file?
Our idea is that, for some reason, jspm thinks the compiler-testing.umd.js file is a folder and so appends /index to it
*we included the angular files via config.js: *
System.config({
defaultJSExtensions: true,
transpiler: "typescript",
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},
map: {
"#angular/common": "npm:#angular/common#2.3.0",
"#angular/compiler": "npm:#angular/compiler#2.3.0",
"#angular/core": "npm:#angular/core#2.3.0",
"#angular/core/testing": "npm:#angular/core#2.3.0/bundles/core-testing.umd.js",
"#angular/forms": "npm:#angular/forms#2.3.0",
"#angular/http": "npm:#angular/http#2.3.0",
"#angular/http/testing": "npm:#angular/http#2.3.0/bundles/http-testing.umd.js",
"#angular/platform-browser": "npm:#angular/platform-browser#2.3.0",
"#angular/platform-browser-dynamic": "npm:#angular/platform-browser-dynamic#2.3.0",
"#angular/platform-browser-dynamic/testing": "npm:#angular/platform-browser-dynamic#2.3.0/bundles/platform-browser-dynamic-testing.umd.js",
"#angular/router": "npm:#angular/router#3.3.0",
After a long and extensive search and hours of comparison, I actually found the problem and the solution to all this:
Problem: the angular2 examples all use the npm_modules and so they adapted the systemjs file to use the npm folder, however, we opt to use JSPM as this makes a clean cut between our backend/infrastructure and our frontend. Allowing us to, without having to change our configuration, add/remove/upgrade packages. Because angular2 modules are actually 2 modules in one, it caused JSPM to to funny things with this and thus, in the end, always tried to load the wrong file: e.g. "core-testing.umd.js/index" instead of just "core-testing.umd".
Solution: finally I struck gold: update to jspm 0.17 (at the time of writing this is still in beta)
The new JSPM correctly detects the testing module as well and loading is now done correctly!

OTRS 4.0 Error No config option found for the view 'Custom'

I was using version 3.3 of the otrs and decided to upgrade to 4.0.9. I took to first uninstall all the modules that are not official (KIX4OTRS, complement and others), but after the upgrade by following the steps of the official documentation, without mistakes, I'm in trouble while trying to access the overview in the CMDB . The error occurs only in the overview, the creation and modification of items usually works.
Even after removing the KIX4OTRS still contained some messages it.
Error:
Backend ERROR: OTRS-CGI-10 Perl: 5.16.0 OS: linux Time: Wed Oct 21 14:26:45 2015 Message: No config option found for the view 'Custom'! RemoteAddress: 191.1.200.123 RequestURI: /otrs/index.pl?Action=AgentITSMConfigItem Traceback (3255): Module: Kernel::Output::HTML::LayoutITSMConfigItem::ITSMConfigItemListShow Line: 332 Module: Kernel::Modules::AgentITSMConfigItem::Run Line: 302 Module: Kernel::System::Web::InterfaceAgent::Run Line: 996 Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 41 Module: (eval) (v1.99) Line: 204 Module: ModPerl::RegistryCooker::run (v1.99) Line: 204 Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170 Module: ModPerl::Registry::handler (v1.99) Line: 31
*I checked the Perl modules are all Okay
*My ITSM is version 4.0.9
It worked! Finally ... I used DataBase Browser software and deleted some entries and now I can access the CMDB. I deleted some entries referring to my ID in the table "user_preferences" session_id and session_profile. I'm not sure with was responsible for solving the problem.