After following the solution on github, and the solution on Stack Overflow, I am still experiencing the same issue when building a code pipeline with AWS CDK.
Error:
This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version.
(Cloud assembly schema version mismatch: Maximum schema version supported is 21.0.0, but found 22.0.0)
This error appears in the Code Build Stage of the Code Pipeline. Sourcing the code from Code Commit works successfully, as the first stage.
CDK Pipeline Code:
As you can see in the code below, I have the install commands of uninstalling the cdk, and then installing it again. This was the recommended solution provided by the document above. Re-ordering does not influence the outcome.
this.codePipeline = new CodePipeline(this, `${environment}-${appName}-`, {
pipelineName: `${environment}-${appName}-`,
selfMutation: true,
crossAccountKeys: false,
role: this.codePipelineRole,
synth: new ShellStep("Deployment", {
input: CodePipelineSource.codeCommit(this.codeRepository, environment, {
codeBuildCloneOutput: true
}),
installCommands: ["npm uninstall -g aws-cdk", "npm i -g npm#latest", "npm install -g aws-cdk"],
commands: [
"cd backend",
"npm ci",
"npm run build",
"npx cdk synth",
],
primaryOutputDirectory: "backend/cdk.out",
})
});
Dependencies in the package.json file:
"dependencies": {
"#aws-cdk/aws-appsync-alpha": "^2.55.1-alpha.0",
"aws-cdk-lib": "^2.58.0",
"aws-sdk": "^2.1278.0",
"constructs": "^10.1.204",
"git-branch": "^2.0.1",
"source-map-support": "^0.5.21"
}
The solution was to do without the npx in npx cdk synth. I removed it and the code worked. This was also experienced when attempting to run npx cdk synth locally.
Solution: cdk synth
I try to execute bower commands in a sh script that is run in the after-success phase o a travis build. I installed bower in the install phase:
install:
- npm install -g bower
[...]
after_success:
- if [ ${TRAVIS_PULL_REQUEST} = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
./my-script.sh;
fi
Unfortunately, if I call bower in the sh script it produces the following output:
./my-script.sh: line 30: ./node_modules/.bin/bower: No such file or directory
I do not know how to proceed to fix the error. Any help would be greatly appreciated, thank you already!
I had to call the script using
bash my-script.sh;
instead of
./my-script.sh;
Now everything is working fine.
I have a JVM-based project that uses the Nashorn Javascript engine. It builds and tests locally fine. When using travis.ci my unit tests explode with NullPointerExceptions because ScriptEngineManager.getEngineByName("nashorn") is returning null.
Here's the travis.yml I'm using:
language: scala
scala:
- 2.11.8
notifications:
email:
recipients:
- info#blocke.com
jdk:
- oraclejdk8
script:
- sbt clean coverage test coverageReport && sbt coverageAggregate
before_install:
- export TZ=America/Chicago
- date
after_success:
- sbt coverageReport coveralls
addons:
apt:
packages:
- oracle-java8-installer
Moving to oraclejdk11 solved the problem!
I use:
VS Code 1.14.1
Tasks 2.0
node 6.11.1
My problem is that some tasks are working, and some are not.
Here my tasks.json file.
{
"version": "2.0.0",
"tasks": [
{ // This task work fine.
"label": "tsc",
"type": "typescript",
"tsconfig": "tsconfig.json",
"group": {
"kind": "build",
"isDefault": true
}
},
{ // This task work fine.
"taskName": "css",
"type": "shell",
"command": "./scss.sh",
"windows": {
"command": "./scss.cmd"
},
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{ // This task not work. (See output #1 below)
"taskName": "npm-install",
"type": "shell",
"command": "npm install",
"problemMatcher": [],
"presentation": {
"reveal": "always",
}
},
{ // This task not work. (See output #2 below)
"type": "gulp",
"task": "clean",
"problemMatcher": []
}
]
}
Output #1 - When I try to run npm task with type shell\npm, I get the same result:
> Executing task: npm install <
Usage: npm <command>
where <command> is one of:
access, adduser, bin, bugs, c, cache, completion, config,
ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get,
help, help-search, i, init, install, install-test, it, link,
list, ln, login, logout, ls, outdated, owner, pack, ping,
prefix, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, tag, team, test, tst, un, uninstall,
unpublish, unstar, up, update, v, version, view, whoami
npm <cmd> -h quick help on <cmd>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
C:\Users\usr\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm#3.10.10 C:\Program Files\nodejs\node_modules\npm
Output #2 - When I try to run gulp task I get next (gulp package installed as global (npm install gulp -g),(I have gulpfile.js with correct content)):
> Executing task: node_modules\.bin\gulp.cmd clean <
clean: node_modules.bingulp.cmd: command not found
I can use gulp, npm, node and other tools from cmd as usually, and it's works fine, but not in the VS Code.
Current solution of this thing:
Create batch files for each stuff.
Create shell task for each batch file (as scss.cmd)
Run those tasks.
Yep, it works well, but you need to do too much action for simple tasks.
What can you advise in this regard?
I found a solution to this problem, the problem was in the default terminal application.
By default on Windows OS visual studio code use powershell as terminal app, in my case, I changed it to the git-bash app and got this problem. After that I changed it back to powershell and all works fine.
I did not bother about why gitbash does not work, it is possible that additional configuration is required in the configuration in the vs code.
This is an issue in VS Code. A < gets added at the end of commands, making them fail. There doesn't seem to be a direct fix at the moment.
I try to make nyc working with coveralls following the instruction:
https://github.com/istanbuljs/nyc#integrating-with-coveralls
But I can't get it to work. Here is an example repo:
https://github.com/unional/showdown-highlightjs-extension
Travis build is successful: https://travis-ci.org/unional/showdown-highlightjs-extension
And Coveralls notice the build, but does not seem to get any data:
https://coveralls.io/github/unional/showdown-highlightjs-extension
Here is my .travis.yml:
language: node_js
notifications:
email:
on_success: never
on_failure: change
node_js:
- "stable"
before_install:
- npm install -g npm
script:
- npm run verify
after_script:
- npm install coveralls && npm run coveralls
And here is my package.json:
{
...
"scripts": {
"coverage": "npm test && nyc check-coverage --branches 85 --functions 85 --lines 85",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"test": "npm run clean && tsc && nyc ava"
...
},
"nyc": {
"exclude": [
"scripts",
"**/*.spec.*",
"**/fixtures/**/*"
]
},
...
}
Try adding your Coveralls repo API token (which can be found on the Coveralls page for your repo) to a new COVERALLS_REPO_TOKEN encrypted environment variable on Travis, as per the (somewhat sketchy) documentation on the Coveralls site.
I found out the issue is in my tsconfig.json:
{
"compilerOptions": {
"sourceRoot": "/showdown-highlight-extension"
...
}
}
This setting gives me the correct (I assume) source map in the browser. See What's the proper way to set sourceRoot in typescript?
But is not liked by the coverage tool.
Once I remove it, it starts working.
Need to find an answer to that question.