Testcafe fails on Jenkins built - jenkins

I've made everything from https://devexpress.github.io/testcafe/documentation/guides/continuous-integration/jenkins.html. But builds fails always:
node --version
v14.2.0
npm --version
6.14.4
grunt --version
grunt-cli v1.2.0
bower --version
1.8.8
npm install testcafe testcafe-reporter-xunit
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 urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated core-js#1.2.7: 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.
core-js#2.6.11 postinstall /var/lib/jenkins/jobs/testcafe/workspace/node_modules/core-js
node -e "try{require('./postinstall')}catch(e){}"
npm WARN saveError ENOENT: no such file or directory, open '/var/lib/jenkins/jobs/testcafe/workspace/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/var/lib/jenkins/jobs/testcafe/workspace/package.json'
node_modules/.bin/testcafe chrome tests/smokeTest.js -r xunit:res.xml -s takeOnFails=true
/tmp/jenkins4618268829523592648.sh: 20: /tmp/jenkins4618268829523592648.sh: node_modules/.bin/testcafe: not found
Build step 'Execute shell' marked build as failure
Recording test results
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE
What am I doing wrong?

Related

SAFE Stack - installing pre-requisites

The SAFE Stack Documentation says to install npm (amongst other things) as a pre-requisite to build SAFE apps. But the link refers to https://www.npmjs.com where you have to search for packages. But which ones? What to install? There are thousands of packages there.
UPDATE:
I have just noticed that the npm documentation says that npm comes bundled with node, & most third-party distributions, by default. So why does the SAFE Stack documentation show the link to npm? Is there any sense in it?
I have tried to install the npm package via NuGet. But whatever I do, running the SAFE standard template in VS ends with a NullReferenceException:
File helpers.fs
let runOrDefault args =
try
match args with
| [| target |] -> Target.runOrDefault target
| _ -> Target.runOrDefault "Run" //NullReferenceException
0
with e ->
printfn "%A" e
1
Entering dotnet run through a command prompt opens a console window containing these messages:
Starting target 'InstallClient'
.> "C:\Program Files\nodejs\npm.CMD" install (In: false, Out: false, Err: false)
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: undefined
npm ERR! notsup Not compatible with your version of node/npm: undefined
npm ERR! notsup Required: {"node":"~16","npm":"~8"}
npm ERR! notsup Actual: {"npm":"8.19.2","node":"v19.0.0"}
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2022-11-04T11_38_04_408Z-debug-0.log
Finished (Failed) 'InstallClient' in 00:00:02.0540071
UPDATE:
In line with Tomáš Petříček's recommendation, I installed this version of node.js: Latest LTS Version: 18.12.0 (includes npm 8.19.2)
But again, NullReferenceException in VS, and the following error messages appear when using the command prompt:
Starting target 'InstallClient'
.> "C:\Program Files\nodejs\npm.CMD" install (In: false, Out: false, Err: false)
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: undefined
npm ERR! notsup Not compatible with your version of node/npm: undefined
npm ERR! notsup Required: {"node":"~16","npm":"~8"}
npm ERR! notsup Actual: {"npm":"8.19.2","node":"v18.12.0"}
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2022-11-04T13_19_03_959Z-debug-0.log
Finished (Failed) 'InstallClient' in 00:00:01.9942657
---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target Duration
------ --------
Clean 00:00:00.5118885
InstallClient 00:00:01.9937254 (Process exit code '1' <> 0. Command Line: C:\Program Files\nodejs\npm.CMD install)
Run 00:00:00 (skipped)
Total: 00:00:02.6111670
Status: Failure
---------------------------------------------------------------------
Fake.Core.BuildFailedException: Target 'InstallClient' failed.
I think all you need to install is Node.js from the official download page There are two versions:
LTS (stable) - version 18 and
Current (development) - version 19
I previously installed "Current" and then run into various troubles (though different ones than you are reporting). You also seem to have 19 according to the log. I gave up with Current and reverted my setup to the LTS version. So perhaps uninstalling the Node version you have right now and installing Node LTS may help.
These adaptations made it possible to run the SAFE standard template on my PC in line with the Quick Start guidelines:
Pre-requisites:
The .NET 6 SDK //OK
node.js (>= 8.0) //OK
npm //do not use this link
Azure CLI (optional - required for Azure deployments) //OK
Continue with guidlines 1 to 6 in the "Create your first SAFE app" section. Use cmd for the dotnet run command.
Look at the node and npm versions in this error message example:
npm ERR! notsup Actual: {"npm":"8.19.2","node":"v18.12.0"}
You may have different versions of npm and node, of course.
In line with this article by Adam Johnson, do this:
Open package.json in the root folder of the template and change the versions of npm and node accordingly, like this:
"private": true,
"engines": {
"node": "18.x",
"npm": "8.x"
}
To suppress warnings, you may add *.npmrc file containing the text string engine-strict=true next to the package.json file.
This answer, however, does not solve the problem why there is a link to npm in the pre-requisites section.
The solution in this answer looks somewhat complicated so if you have got a better idea, it will be fine if you publish it.
UPDATE 08-Nov-2022
Instructions telling you how to run/debug a SAFE Stack app in Visual Studio are here. Then no more problems with NullReferenceExceptions.

Building a vue.js application with docker multistage fails on COPY

I have a problem with a vue.js application that I want to deploy with docker. The deployment has always worked fine with this version of the docker configuration files but since importing large files on the application I have a pretty known error. I found multiple topics with the same problem but no solution works for me.
package.json
{
"name": "[...]",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
[...]
}
The Dockerfile
#build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# production stage
FROM nginx:stable-alpine as production-stage
COPY ./nginx_config/nginx.conf /etc/nginx/nginx.conf
RUN rm -rf /usr/share/nginx/html/*
# RUN ls -lart
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Docker-compose.yml
version: '3.7'
services:
portfolio:
container_name: portfolio
build:
context: .
dockerfile: Dockerfile
ports:
- '80:80'
Building logs
Building portfolio
Step 1/13 : FROM node:lts-alpine as build-stage
---> 8e69714aa82b
Step 2/13 : WORKDIR /app
---> Using cache
---> c1e93cbee6d6
Step 3/13 : ENV PATH /app/node_modules/.bin:$PATH
---> Using cache
---> 23f0528e6c9f
Step 4/13 : COPY package*.json ./
---> 03789a2585f2
Step 5/13 : RUN npm install
---> Running in a7f62007da83
npm WARN deprecated babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated vue-cli#2.9.6: This package has been deprecated in favour of #vue/cli
npm WARN deprecated html-webpack-plugin#3.2.0: 3.x is no longer supported
npm WARN deprecated eslint-loader#2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise-native#1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
npm WARN deprecated coffee-script#1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
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 har-validator#5.1.5: this library is no longer supported
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request#2.16.6: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated core-js#2.6.12: core-js#<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
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 querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN deprecated hawk#0.10.2: This module moved to #hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated boom#0.3.8: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek#0.7.6: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated cryptiles#0.1.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated sntp#0.1.4: This module moved to #hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated json3#3.2.6: Please use the native JSON object instead of JSON 3
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated node-uuid#1.4.1: Use uuid module instead
> ws#0.4.31 install /app/node_modules/tomahawk/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
> ws#0.4.31 install /app/node_modules/tomahawk/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
> yorkie#2.0.0 install /app/node_modules/yorkie
> node bin/install.js
setting up Git hooks
can't find .git directory, skipping Git hooks installation
> node-sass#5.0.0 install /app/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v5.0.0/linux_musl-x64-83_binding.node
Download complete
Binary saved to /app/node_modules/node-sass/vendor/linux_musl-x64-83/binding.node
Caching binary to /root/.npm/node-sass/5.0.0/linux_musl-x64-83_binding.node
> #fortawesome/fontawesome-common-types#0.2.36 postinstall /app/node_modules/#fortawesome/fontawesome-common-types
> node attribution.js
Font Awesome Free 0.2.36 by #fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
> core-js#3.19.1 postinstall /app/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js
> https://patreon.com/zloirock
> https://paypal.me/zloirock
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> ejs#2.7.4 postinstall /app/node_modules/ejs
> node ./postinstall.js
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
> core-js#2.6.12 postinstall /app/node_modules/raf-manager/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> #fortawesome/free-brands-svg-icons#5.15.4 postinstall /app/node_modules/#fortawesome/free-brands-svg-icons
> node attribution.js
Font Awesome Free 5.15.4 by #fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
> #fortawesome/free-solid-svg-icons#5.15.4 postinstall /app/node_modules/#fortawesome/free-solid-svg-icons
> node attribution.js
Font Awesome Free 5.15.4 by #fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
> node-sass#5.0.0 postinstall /app/node_modules/node-sass
> node scripts/build.js
Binary found at /app/node_modules/node-sass/vendor/linux_musl-x64-83/binding.node
Testing binary
Binary is fine
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for dns#0.1.5: wanted: {"node":">= 0.10.0 < 0.11.0"} (current: {"node":"14.17.0","npm":"6.14.13"})
npm WARN notsup Not compatible with your version of node/npm: dns#0.1.5
npm WARN notsup Unsupported engine for tomahawk#0.1.5: wanted: {"node":">= 0.8.0 < 0.11.0"} (current: {"node":"14.17.0","npm":"6.14.13"})
npm WARN notsup Not compatible with your version of node/npm: tomahawk#0.1.5
npm WARN notsup Unsupported engine for hawk#0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"14.17.0","npm":"6.14.13"})
npm WARN notsup Not compatible with your version of node/npm: hawk#0.10.2
npm WARN notsup Unsupported engine for hoek#0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"14.17.0","npm":"6.14.13"})
npm WARN notsup Not compatible with your version of node/npm: hoek#0.7.6
npm WARN notsup Unsupported engine for boom#0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"14.17.0","npm":"6.14.13"})
npm WARN notsup Not compatible with your version of node/npm: boom#0.3.8
npm WARN notsup Unsupported engine for cryptiles#0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"14.17.0","npm":"6.14.13"})
npm WARN notsup Not compatible with your version of node/npm: cryptiles#0.1.3
npm WARN notsup Unsupported engine for sntp#0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"14.17.0","npm":"6.14.13"})
npm WARN notsup Not compatible with your version of node/npm: sntp#0.1.4
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.3.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN #fortawesome/vue-fontawesome#2.0.6 requires a peer of #fortawesome/fontawesome-svg-core#~1 || >=1.3.0-beta1 but none is installed. You must install peer dependencies yourself.
npm WARN request-promise-native#1.0.9 requires a peer of request#^2.34 but none is installed. You must install peer dependencies yourself.
npm WARN request-promise-core#1.1.4 requires a peer of request#^2.34 but none is installed. You must install peer dependencies yourself.
added 1815 packages from 726 contributors and audited 1819 packages in 64.473s
95 packages are looking for funding
run `npm fund` for details
found 92 vulnerabilities (14 low, 35 moderate, 41 high, 2 critical)
run `npm audit fix` to fix them, or `npm audit` for details
Removing intermediate container a7f62007da83
---> 6d342fed97bc
Step 6/13 : COPY . .
---> 11ec260a395b
Step 7/13 : RUN npm run build
---> Running in 90b0c3e10671
> portfolio-vpoujade#0.1.0 build /app
> vue-cli-service build
- Building for production...
Removing intermediate container 90b0c3e10671
---> 1635da3cea2f
Step 8/13 : FROM nginx:stable-alpine as production-stage
---> e1ccef1fb908
Step 9/13 : COPY ./nginx_config/nginx.conf /etc/nginx/nginx.conf
---> Using cache
---> d4839c3fabf3
Step 10/13 : RUN rm -rf /usr/share/nginx/html/*
---> Using cache
---> f78f258f926c
Step 11/13 : COPY --from=build-stage /app/dist /usr/share/nginx/html
ERROR: Service 'portfolio' failed to build: COPY failed: stat app/dist: file does not exist
And when I deploy the application with the docker-compose up --build -d command, at step 12:
COPY --from=build-stage /app/dist/ /usr/share/nginx/html
, I get the error
ERROR: Service 'portfolio' failed to build: COPY failed: stat app/dist: file does not exist
Thank you in advance!

Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH. Could you tell me what the problem is?

I'm using npm install -g yo gulp to install yeoman and this is the error I'm getting
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
C:\Usr\local\gulp -> C:\Usr\local\node_modules\gulp\bin\gulp.js
C:\Usr\local\yo -> C:\Usr\local\node_modules\yo\lib\cli.js
C:\Usr\local\yo-complete -> C:\Usr\local\node_modules\yo\lib\completion\index.js
> yo#3.1.0 postinstall C:\Usr\local\node_modules\yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
√ No .bowerrc file in home directory
√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ No .yo-rc.json file in home directory
√ Node.js version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
× yo version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
√ npm version
Found potential issues on your machine :(
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\gulp\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ gulp#4.0.2
+ yo#3.1.0
updated 2 packages in 23.31s
Run the following command to see where npm puts global packages
npm config get prefix
You'll get output similar to this
/usr/local/Cellar/node/10.5.0_1
Copy the output or path and then using any code editor open your .bashrc or .zshrc file depending on the terminal you use and paste like so
export PATH="$PATH:"/usr/local/Cellar/node/10.5.0_1/bin/""
Then after saving run
source ~/.zshrc
Like Xander Cage said.
I have uninstalled node.js -> procedure here
I have restarted my PC.
Then I installed again node.js
It work.
The above didn't work for me at all.
The following solved my problem:
clean installed nodejs and followed steps by dv-here in thread: https://github.com/zkat/npx/issues/100
Note that my npm kept pointing to C:\usr...
I think I set the npm config set prefix= to something mistakenly due to which I was >getting the error. Here's how I fixed it:
Open CMD in "Administrator" mode.
npm cache clear --force
npm install
npm config set cache C:\Users\myname\AppData\Roaming\npm-cache
npm config set prefix C:\Users\myname\AppData\Roaming\npm
I just ran into this issue on MacOS, and saw that all of my global npm binaries were symlinked into the /usr/local/bin directory, except for yo. I created a symlink using this command:
ln -s /usr/local/Cellar/node/12.10.0/bin/yo /usr/local/bin/yo
(Yours may vary)
And yo is now callable.
I had same issue and I really didn't want uninstall nodejs as I have a lot of package installed.
Tried also with the second answer and did not worked.
Then I found this ticked, that is been closed:
https://github.com/yeoman/yeoman/issues/1716
install with yarn command for me worked.
yarn global add yo
Seem then the installation went through with also binary installed.
Nevermind try to install it with npm getting same error, so looking for provide more infos

npm install PATH for postinstall scripts on Jenkins

My JS project uses a NPM package called commitizen:
https://github.com/commitizen/cz-cli
commitizen is added to my devDependencies in package.json file.
commitizen uses internally a package called opencollective as you can see here: https://github.com/commitizen/cz-cli/blob/master/package.json
commitizen on postinstall hook is calling opencollective postinstall which is supposed to run opencollective package binary.
Locally I've no problems running the postinstall hook, however, when I build my project on my Jenkins CI box I get this error when it runs the postinstall hook of commitizen package
sh: 1: opencollective: not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! commitizen#2.10.1 postinstall: `opencollective postinstall`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the commitizen#2.10.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I tried to add node_modules/opencollective/dist/bin dir to the PATH but with no luck, I think because the opencollective alias is defined in opencollective package.json
Any idea about how to be able to run opencollective command without installing globally opencollective package?
Thank you!

Unable to install appium from npm because of chrome driver installation failure

I have installed nodejs 8.11.1 in my system. Trying to install appium using below npm command.
npm -g install appium
After hitting the command after 10 mnts iam getting below error regarding chrome deiver installation.
C:\Windows\system32>npm -g install appium
C:\Users\fedexuser\AppData\Roaming\npm\appium -> C:\Users\fedexuser\AppData\Roam
ing\npm\node_modules\appium\build\lib\main.js
> appium-chromedriver#3.5.2 install C:\Users\fedexuser\AppData\Roaming\npm\node_
modules\appium\node_modules\appium-chromedriver
> node install-npm.js
info Chromedriver Install Installing Chromedriver version '2.37' for platform 'w
in' and architecture '32'
info Chromedriver Install Opening temp file to write chromedriver_win32 to...
info Chromedriver Install Downloading https://chromedriver.storage.googleapis.co
m/2.37/chromedriver_win32.zip...
RequestError: Error: connect ETIMEDOUT 172.217.0.80:443
at new RequestError (C:\Users\fedexuser\AppData\Roaming\npm\node_modules\app
ium\node_modules\request-promise-core\lib\errors.js:14:15)
at Request.plumbing.callback (C:\Users\fedexuser\AppData\Roaming\npm\node_mo
dules\appium\node_modules\request-promise-core\lib\plumbing.js:87:29)
at Request.RP$callback [as _callback] (C:\Users\fedexuser\AppData\Roaming\np
m\node_modules\appium\node_modules\request-promise-core\lib\plumbing.js:46:31)
at self.callback (C:\Users\fedexuser\AppData\Roaming\npm\node_modules\appium
\node_modules\request\request.js:186:22)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at Request.onRequestError (C:\Users\fedexuser\AppData\Roaming\npm\node_modul
es\appium\node_modules\request\request.js:878:8)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.2 (node_modules\app
ium\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#
1.2.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-chromedriver#3.5.2 install: `node install-npm.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-chromedriver#3.5.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\fedexuser\AppData\Roaming\npm-cache\_logs\2018-04-25T10_40
_52_539Z-debug.log
If you are behind a proxy, try to set this before running your npm command
e.g. set HTTP_PROXY=http://[proxy server address]:[port number]
I had also some issues with node 8.x and Appium install via NPM. Did found newly opened Known Issue for Appium 1.8.0 and Node 10.0.0, so had to combine one of the suggestions with extra flags. This fix it for me:
Edited:
sudo npm install -g appium#1.7.2 --unsafe-perm=true --allow-root

Resources