jasmine is not defined - jasmine-node

I am trying to run a rest API test on Enide Studio using friby.js and Jasmine.
I got this error:
C:\Users\xxxx\AppData\Roaming\npm\node_modules\frisby\lib\frisby.js:1125
jasmine.Matchers.prototype.toMatchOrBeNull = function(expected) {
^
ReferenceError: jasmine is not defined
at Object.<anonymous> (C:\Users\xxxx\AppData\Roaming\npm\node_modules\frisby\lib\frisby.js:1125:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\xxxx\Desktop\Enide-Studio-2014.17-luna-SR1-win64\ws\SampleProject\.settings\sample_spec.js:4:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
I tried the same script in note pad and ran using CLI, it worked well.
Please help me as I need to run this on a IDE.

I had similar problem after migrating to Jasmine 2.x. It became obvious that 2.x is currently not supported in Frisby.
Although, a frisby fork at https://github.com/m0x72/frisby solves this probelem.
cd node_modules
git clone https://github.com/m0x72/frisby.git
npm install qs
npm install jsonschema
npm install stack-trace
You may include it in your test file as follows:
// var frisby = require('frisby');
var frisby = require('frisby-master');

Related

Can't build Visual Studio Code source - "Error: Cannot find module 'gulp-bom'"

I am trying to build Visual Studio Code so the dependencies are compiled in (can't install rpm packages as I don't have root). I have worked through a few issues so far, but I can't figure out why I am getting the following error.
[mrhicks#xxxxxx repo]$ yarn run watch
yarn run v1.12.3
$ gulp watch --max_old_space_size=4095
[20:28:22] Node flags detected: --max_old_space_size=4095
[20:28:22] Respawned to PID: 27503
module.js:550
throw err;
^
Error: Cannot find module 'gulp-bom'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/users/mrhicks/projects/vscode/repo/build/lib/compilation.js:10:13)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I have make sure to re-run sudo npm install to try and ensure everything for npm is installed. I have been following the instructions from the VSCode site here
I had this locally. It went away after yarn add gulp-bom --no-save. 🤷‍♂️
If you applied the changes at https://github.com/addaleax/natives/commit/0abbec6b0e211c6bbe3bf0d2b33fcd68f5a6c980, you'll need to re-apply them after.

Error in installing Ionic

I'm a beginner for Ionic and getting mentioned error when i'm run the bellow code,
ionic start IonicShoppingList blank
Error: Cannot find module 'lodash._basecopy'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Denuka\AppData\Roaming\npm\node_modules\ionic\node_modules\lodash._baseassign\index.js:9:16)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
I have installed node.js npm and ionic cordova.
What should i do to solve this ?
Be sure to install lodash in the required folder.
If that folder has a package.json file, it is also best to add --save behind the install command.
$ npm install lodash --save
if the package.json file exists, and if it contains the lodash dependency you could try to remove the node_modules folder and run following command:
$ npm cache clean
$ npm install
The first command will clean the npm cache. (just to be sure) The second command will install all (missing) dependencies of the project.
I hope it helps.

ionic Gulpfile (or dependent module) not found

I'm trying to open a project that i downloaded from github.the project uses ionic 2 but it returns this error :
[ERROR] Gulpfile (or dependent module) not found: .\gulpfile.js
For custom Gulpfile locations, you can run ionic config set gulp.file
<path>. Otherwise, the default Ionic Gulpfile can be downloaded from
https://github.com/ionic-team/ionic-app-base/blob/master/gulpfile.js
Or, if you don't use gulp, you can disable it by running ionic config
set gulp.enabled false.
Full error:
Error: Cannot find module 'ionic-gulp-sass-build'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (F:\ionic3\exemple
taxi\Ionic-2-Uber-master\gulpfile.js:31:17)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
i tried some solutions like :
1-Delete your node_modules folder
2-Remove gulp-sass from your package.json file
3-Remove node-sass from your package.json file (if you have it in there)
4-Run npm install gulp-sass --save-dev
Also this one :
1-update version-clean
2-the node_module and executenpm install
3-may be npm cache
But i still have the same error .Is it that i installed ionic3 and the project runs in ionic 2 the cause of the problem ?

Cannot find module ionic linux

I took a project from my friend (mac) and I put this project on my pc (linux) but it didn't work. I tried but nothing.
Error: Cannot find module '/home/nihed/Desktop/cleantoufoulakids3/node_modules/#ionic/app-scripts'
at Function.Module._resolveFilename (module.js:513:15)
at Function.Module._load (module.js:463:25)
at Module.require (module.js:556:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-utils/lib/ionic-angular/app-scripts.js:9:16)
at Generator.next (<anonymous>)
at /usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:103:75
at new Promise (<anonymous>)
at Object.__awaiter (/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:99:16)
at Object.importAppScripts (/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-utils/lib/ionic-angular/app-scripts.js:7:20)
I think you should run npm install and ionic cordova prepare to install packages and plugins from the package.json.
Did you just copy node_modules directory too?

Bluemix Securegatway Installation Error on Windows Server 2012 R2

Installation goes through fine but we keep on getting this error message once launching the client's UI:
The command is: node lib\secgwclient.js cEm9COT0o411_prod_ng --1 INFO --P 9003 module.js:457
throw err;
Error: Cannot find module 'log4js'
at Function.Module.resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17) at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Program Files (x86)\Secure Gateway Client\ibm\securegateway\client\lib\utils\logging.js:26:18)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
The error is complaining about log4js module Cannot find log4js module. I tried manually installing the log4js modue using npm, but the error persists.
This issue usually indicates that the install is behind a firewall or proxy which caused the npm install to fail. Does the machine have outbound access to npmjs.com:443?
You can either re-install the client or run npm install from the client folder. If npm is not a globally recognized command, you will need to provide the path to npm that is packaged with the node version contained within the installation folder.