Cant run cypress using UI - cypress

I can run my scripts using editor in headless mode but scripts are failing when tried to run using cypress UI
Getting error
From Node.js Internals:Error: socket hang upat connResetException (node:internal/errors:690:15)at Socket.socketOnEnd (node:_http_client:471:24)at Socket.emit (node:events:406:36)at endReadableNT (node:internal/streams/readable:1331:13)at processTicksAndRejections (node:internal/process/task_queues:83:22)
Try to upgrade cypress version from 9.4.1. to 10.1.0 but again getting error
PS C:\Users\hshah\cypress> npm install --save-dev cypress#10.0.3
npm ERR! must provide string spec
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\hshah\AppData\Local\npm-cache_logs\2022-06-20T05_10_05_825Z-debug.log
PS C:\Users\hshah\cypress>
Not sure what can be the reason?

Remove your package-lock.json file and node_modules folder.
In your package.json, change the cypress version to 10.1.0
Run the command npm cache clean --force
Then run the command npm install. This will install all the dependencies listed in your package.json file.

Related

In terminal 'tns preview' command not working. (NativeScript)

I wanted to run my NS application in local. I downloaded project from play.nativescript.org, And I open cmd with target path and I followed this steps
Step 1. Install the latest NativeScript CLI
Type the following command in a Command Prompt or Terminal.
npm install -g nativescript#latest
and I have successfully installed the NativeScript CLI
Step 2. Preview your app
Navigate to your project folder and run the following command to start
previewing your app.
tns preview
When I entered the command I get this errors
You are using the deprecated nsconfig.json file. Just be aware that NativeScript 7 has an improved nativescript.config.(js|ts) file for when you're ready to upgrade this project.
npm WARN deprecated bfj-node4#5.3.1: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request#2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! code E404
npm ERR! 404 Not Found - GET https://github.com/thomasconner/javascript/tarball/67b7944366453a87226389d483ac1ad861e0e129npm ERR! 404
npm ERR! 404 'pubnub#https://github.com/thomasconner/javascript/tarball/67b7944366453a87226389d483ac1ad861e0e129' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'kinvey-nativescript-sdk'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dotor\AppData\Roaming\npm-cache\_logs\2020-10-01T09_47_56_177Z-debug.log
Command npm.cmd failed with exit code 1
As in github.com therosko has written, making kinvey-nativescript-sdk version as 5.0.1 worked for me. Src: here
Unfortunately, play.nativescript.org exported projects won't run with nativescript version 7 and up.
Currently, the only solution would be to install {N} CLI using npm install -g nativescript#6.8.0

Install NPM package if not installed using shell script

I want to write a shell script to install NPM package if not already installed.
I can use the command npm info <package-name> version to get information about the package. It gives me the version if it is already there
2.0.0
If it is not there it gives an error.
npm ERR! code E404
npm ERR! 404 Not found :<package>
npm ERR! 404
npm ERR! 404 '<package>' is not in the npm registry.
How can I use this result in a conditional block to do some task depending on it?
I think you're over-complicating things. npm-install already checks if the module is installed and just ignores it if it's already there, so all you need to do is call it:
$ npm install mymodule#2.0.0

Composer runtime (0.18.2) is not compatible with client (0.17.6)

I am trying to run composer-sample-applicaions(Digital Property) but when I am trying to run npm test it is throwing an error: Composer runtime (0.18.2) is not compatible with the client (0.17.6)
Following is the complete log:
paradox#labrats:~/hyperledger/composer/github/composer-sample-applications/packages/digitalproperty-app$ npm test
> digitalproperty-app#0.0.7 test /home/paradox/hyperledger/composer/github/composer-sample-applications/packages/digitalproperty-app
> npm run bootstrapAssets && npm run listAssets && npm run submitTransaction
> digitalproperty-app#0.0.7 bootstrapAssets /home/paradox/hyperledger/composer/github/composer-sample-applications/packages/digitalproperty-app
> node cli.js landregistry bootstrap
info: [DigitalProperty-App] Hyperledger Composer: Digital Property console application
info: [DigitalProperty-App] Adding default land titles to the asset registry
error: [DigitalProperty-App] Error: Error trying to ping. Error: Composer runtime (0.18.2) is not compatible with client (0.17.6)
Command failed.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! digitalproperty-app#0.0.7 bootstrapAssets: `node cli.js landregistry bootstrap`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the digitalproperty-app#0.0.7 bootstrapAssets script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/paradox/.npm/_logs/2018-03-26T09_35_58_193Z-debug.log
npm ERR! Test failed. See above for more details.
paradox#labrats:~/hyperledger/composer/github/composer-sample-applications/packages/digitalproperty-app$
Any lead would be appreciated
The runtime refers to the version of Composer that is installed on to the Peer with your Network - you can see this if you execute docker ps -a and you will see a container with a name such as dev-peer0.org1.example.com-animaltracking-network-0.16.6... this shows the Composer runtime version and the network name.
You have a couple of options:
Re-create your Fabric which will delete that container with the 18.2 runtime
Upgrade your client to 18.2
Different versions of Composer need different versions of Fabric - checkout this document which covers releases of Composer with their supported Fabric versions.
Composer runtime and client must be on same version.
Best approach to solve this issue, execute following commands in order.
npm install -g composer-cli
npm install -g composer-rest-server

webpack 4.1.1 -> The CLI moved into a separate package: webpack-cli. -> No git binary found in $PATH

I just ran the command npm-check-updates -a and updated webpack to 4.1.1. I got the same error as everyone else at first:
The CLI moved into a separate package: webpack-cli. Please install
'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
However when I try to run npm install webpack-cli -D I get the following error:
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
Why does webpack require git to be installed?
If anyone else gets this error and just want to continue you can install the following program, make sure to enable windows command prompt during install.
https://git-scm.com/download/win

Cannot run npm install browserify

I try to run npm install browserify both locally and globally (-g)
but I always got the follow errors
npm ERR! peerinvalid The package bn.js does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer miller-rabin#1.1.2 wants bn.js#^0.16.0
npm ERR! System Darwin 14.0.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "browserify"
npm ERR! cwd /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite/npm-debug.log
npm ERR! not ok code 0
Not sure how to solve it.
(My node version is v0.10.24, I'm on OSX Yosemite)
In order to make the workaround work, you have to
Delete the existing node_modules folder.
npm install miller-rabin#1.1.1 --save-peer
npm install browserify
That works guaranteed.
Had the same issue on Linux. Try running npm update -g
before installing browserify. This has worked for me.
This commit introduced the breaking change: https://github.com/indutny/miller-rabin/commit/bb85f555974587a410a17173f0bc484133b53cb7
The author of the library should fix it, but meanwhile you can:
Delete the existing node_modules folder
npm install miller-rabin#1.1.1 --save-peer
npm install browserify
Recently found this issue on browserify's github.
https://github.com/substack/node-browserify/issues/1049
There is a workaround described.
There are details of a workaround list in the issues on the github page
Error listing
To summarise the solution posted in the issue, you need to install miller-rabin#1.1.1 as a peer-dependency in your own project (npm install miller-rabin#1.1.1 --save-peer) that makes sure the bn.js#0.15 is used rather than the more recent version.
Hope that helps!
Try zipping your existing node_modules and package.json, then delete them.
You may need to 1st generate a new package.json using:
npm init
Then install browserify locally:
npm install browserify
Also, you'll have to install browserify globally:
npm install browserify -g
To zip on CMD or terminal refer to the following article:
How to zip a file using cmd line?

Resources