Error in Couldn't find a package.json file during vuepress-Travis CI construction - travis-ci

What can I do?
Here is the code for the part where the problem occurs
error Couldn't find a package.json file in "/home/travis/build/comter1/document"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command "yarn document:build" exited with 1.
$ yarn cname
yarn run v1.22.4
error Couldn't find a package.json file in "/home/travis/build/comter1/document"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command "yarn cname" exited with 1.
cache.2
store build cache
Done. Your build exited with 1

Try changing following in cname.sh file:
echo 'comter1.github.io/document/' > document/.vuepress/dist/CNAME
to
echo 'comter1.github.io/document/' > ./.vuepress/dist/CNAME

Related

Docker selenium firefox image creation issue

I'm trying to create a selenium firefox node image. I've added the "COPY generate_config /opt/bin/generate_config" command to copy the generate_config file from local. Then when I run the command "RUN /opt/bin/generate_config > /opt/selenium/config.json" , I get error -
**# #10 0.320 /bin/sh: 1: /opt/bin/generate_config: not found
------**
executor failed running [/bin/sh -c /opt/bin/generate_config > /opt/selenium/config.json]: exit code: 127
Can anyone please help me with solution
I tried adding sudo, changing the cat command. nothing worked.

Catch Yarn Exit code 1

I use a shell script in my jenkins pipeline to execute nodeja actions.
It looks like
which yarn || npm install -g yarn
Xvfb :96 -ac -screen 0 1900x1200x24 &
export DISPLAY=:96
#x11vnc start
x11vnc -display $DISPLAY -bg -nopw -xkb &
cd cypress
make build
yarn precy:run
yarn stest
yarn report:merge
yarn report:generate
yarn report:copyScreenshots
The line yarn stest execute the cypress tests and if one fails, it send an exit code 1.
16:02:25 ERROR: Test failures!
16:02:25 ERROR: script returned exit code 1
My problem is, that the shell script ends here when exit code 1 is thrown. the lines;
yarn report:merge
yarn report:generate
yarn report:copyScreenshots
are not executed anymore. Is there a way to catch the exit code 1 from the stest and still run the following lines well? The following lines create reports and I will need them in success and also in failures.

cordova build error when `node cordova/lib/copy-www-build-step.js` in build phase

I am a web developer with no experience in iOS development. Now I'm using Cordova to build iOS app. Because I have no knowledge about iOS or Xcode, it is very hard for me. I always get error like the following output when I built in Xcode or built in command line.
Error info in Xcode build:
Run custome shell script 'Copy www directory'
PhaseScriptExecution Copy\ www\ directory /Users/jyjin/Library/Developer/Xcode/DerivedData/myios-auhioanpfinvvvcrnvoaioslreyr/Build/Intermediates.noindex/myios.build/Debug-iphonesimulator/myios.build/Script-304B58A110DAC018002A0835.sh (in target: myios)
cd /Users/jyjin/workspace/gitProject/Cordova/FirstProject/platforms/ios
/bin/sh -c /Users/jyjin/Library/Developer/Xcode/DerivedData/myios-auhioanpfinvvvcrnvoaioslreyr/Build/Intermediates.noindex/myios.build/Debug-iphonesimulator/myios.build/Script-304B58A110DAC018002A0835.sh
/Users/jyjin/Library/Developer/Xcode/DerivedData/myios-auhioanpfinvvvcrnvoaioslreyr/Build/Intermediates.noindex/myios.build/Debug-iphonesimulator/myios.build/Script-304B58A110DAC018002A0835.sh: line 2: 27158 Segmentation fault: 11 node cordova/lib/copy-www-build-step.js
Command PhaseScriptExecution failed with a nonzero exit code
Error info in command line build:
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Copy\ www\ directory /Users/jyjin/Library/Developer/Xcode/DerivedData/myios-auhioanpfinvvvcrnvoaioslreyr/Build/Intermediates.noindex/myios.build/Debug-iphonesimulator/myios.build/Script-304B58A110DAC018002A0835.sh
(1 failure)
xcodebuild: Command failed with exit code 65
I have read a lot of solutions on websites, and finally I found that there were some script in build phase:
NODEJS_PATH=/usr/local/bin; NVM_NODE_PATH=~/.nvm/versions/node/`nvm version 2>/dev/null`/bin; N_NODE_PATH=`find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1`/bin; XCODE_NODE_PATH=`xcode-select --print-path`/usr/share/xcs/Node/bin; PATH=$NODEJS_PATH:$NVM_NODE_PATH:$N_NODE_PATH:$XCODE_NODE_PATH:$PATH && node cordova/lib/copy-www-build-step.js
after checking out the error message several times, I tried to remove && node cordova/lib/copy-www-build-step.js in Build Phases, it builds successfully, but with no page effect expected in html (Cause no www resource copied I think).
and I tried to check out some env PATH value in copy-www-build-step.js,so I wrote some log code in copy-www-build-step.js, but have no idea how to print js logs in Xcode. Then I found cordova-plugin-console, but npm doc said it is duplicated, and contains the last version for Cordova, and mine is also the latest.
Oh, God!One week passed... I just want to build an iOS app. It’s so hard to play. The ghost knows what I experienced:Configuring certificates, profile, building a Cordova app from scratch, even spending $99 to buy an apple developer account...
Just want to play an iOS app by myself in my free time ... Hope someone can help me ~~
-- From a desperate Chinese boy !
just update cordova-ios to latest version:
npm i cordova-ios#latest
you can see this problem being solved in this PR: #600, they changed the script from javascript to the old shell version and fixed the problem.
Workaround without updating the library
Enter in xCode in the Build Phases tab and click on "Copy www directory" phase, so change the script to:
$SRCROOT/__PROJECT_NAME__/Scripts/copy-www-build-step.sh
"__PROJECT_NAME__ " is the name of xCode project.
After this download the copy-www-build-step.sh script and put it inside the "__PROJECT_NAME__/Scripts/" path.
References
https://github.com/apache/cordova-ios/issues/540
https://github.com/apache/cordova-ios/pull/600/files
https://github.com/apache/cordova-ios/pull/146/files
Oh! I have fixed it~
Firstly, check the script:
NODEJS_PATH=/usr/local/bin; NVM_NODE_PATH=~/.nvm/versions/node/`nvm version 2>/dev/null`/bin; N_NODE_PATH=`find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1`/bin; XCODE_NODE_PATH=`xcode-select --print-path`/usr/share/xcs/Node/bin; PATH=$NODEJS_PATH:$NVM_NODE_PATH:$N_NODE_PATH:$XCODE_NODE_PATH:$PATH && node cordova/lib/copy-www-build-step.js
currently error is xcodebuild: Command failed with exit code 65. This is the first error, the && should be & when running in the mac.
And then, the error turn to be Command /bin/sh failed with exit code 127.And I found xcode error message: node: command not found.
So I run find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1 in the command line. and get the node result path /usr/local/n/versions/node/11.12.0
run
node -v // v10.15.3
So I remove all script in build_phases, and give it node path for my real nvm node path, change build_phases like below:
/Users/jyjin/.nvm/versions/node/v10.15.3/bin/node cordova/lib/copy-www-build-step.js
Build success!
Summary! cordova auto build_phases script maybe not suit your environment, make sure build phase can get your node path!

rails-react-boilerplate: Webpack not compiling

Introduction
I trying to run rails-react-boilerplate, everything goes fine, but at the end of installation (bundle install, yarn install, rake db:create ..), command with webpack simple not working. There is a link on github repository: rails-react-boilerplate.
Error
After this command npm run webpack I get this error:
openssl config failed: error:02001003:system library:fopen:No such process
> rails-react-boilerplate#1.0.0 webpack D:\code\portfolio\liftProgress
> ./node_modules/webpack/bin/webpack.js --progress --colors
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rails-react-boilerplate#1.0.0 webpack:
`./node_modules/webpack/bin/webp
ack.js --progress --colors`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rails-react-boilerplate#1.0.0 webpack 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! C:\Users\Derid\AppData\Roaming\npm-cache\_logs\2017-12-
30T07_27_37_
058Z-debug.log
openssl config failed: error:02001003:system library:fopen:No such process
where I think main problem is:
'.' is not recognized as an internal or external command,
operable program or batch file.
.. but I am at one's wits' end .. very thanks for your guidance and help!:)
This is a Windows issue, you can try omitting the ./ from the actual command on the package.json file.
Actually after doing some research, including the node executable should work cross-platform:
"webpack": "node node_modules/webpack/bin/webpack.js --progress --colors",

fabric-composer quick-start failed on ubuntu 16.04

I'm trying to follow the Fabric Composer Quickstart but failed.
Could you give me hints?
When I tried "sudo npm install", the script was completed with a few warnings.
npm WARN lifecycle getting-started#1.0.0~preinstall: cannot run in wd %s %s (wd=%s) getting-started#1.0.0 composer --version || echo 'Please first run npm install -g composer-cli' /<directory>/sample-applications/packages/getting-started
npm WARN lifecycle getting-started#1.0.0~install: cannot run in wd %s %s (wd=%s) getting-started#1.0.0 scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork /<directory>/sample-applications/packages/getting-started
When I tried "sudo composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d",
List business network digitalproperty-network
2017-03-21T22:44:47.360Z ERROR FSConnectionProfileStore :load() Failed to loaded connection profile defaultProfile {"0":{"stack":["{Error}ENOENT: no such file or directory, open '<directory>.composer-connection-profiles/defaultProfile/connection.json' Error: ENOENT: no such file or directory, open '<directory>.composer-connection-profiles/defaultProfile/connection.json'"," at Error (native)"]}}$
Failed to load connection profile defaultProfile
Command completed successfully.
I use
Ubuntu: 16.04
docker: 1.13.1
docker-compose: 1.11.2
node: v6.10.0
npm: 4.4.4
git: 2.11.0
composer:
composer-cli v0.5.5
composer-admin v0.5.5
composer-client v0.5.5
composer-common v0.5.5
composer-runtime-hlf v0.5.5
composer-connector-hlf v0.5.5
It looks like I have .composer-connection-profiles/defaultProfile/ direcotry but the directory don't have connection.js
How can we solve the problem? can i prepare connection.js manually?
Thank you!
This problem occurs when you run the npm install using sudo.
it shouldn't be necessary to run the commands as root so try again without using sudo and see if that helps.
This solves the problem npm install composer-connector-hlf

Resources