i use brew to install jhipster and the current version is 4.14.4 . and i have generated a 4.14.3 version project.how can i update the existing project to 4.14.4 and contain the code that i generated on 4.14.3 . here is the detail:
brew info jhipster
jhipster: stable 4.14.4 (bottled)
Generate, develop and deploy Spring Boot + Angular applications
https://jhipster.github.io/
/usr/local/Cellar/jhipster/4.14.1 (9,066 files, 31.7MB)
Poured from bottle on 2018-03-25 at 10:49:51
/usr/local/Cellar/jhipster/4.14.3 (9,076 files, 31.9MB)
Poured from bottle on 2018-04-18 at 22:01:45
/usr/local/Cellar/jhipster/4.14.4 (9,075 files, 31.9MB) *
Poured from bottle on 2018-05-17 at 23:04:12
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/jhipster.rb
==> Dependencies
Required: node ✔, yarn ✔
==> Requirements
Required: java >= 1.8 ✔
and the .yo-rc.json file is :
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.sgcc.syn",
"nativeLanguage": "zh-cn"
},
"jhipsterVersion": "4.14.3",
"baseName": "pmt",
"packageName": "com.sgcc.syn",
"packageFolder": "com/sgcc/syn",
"serverPort": "8080",
"authenticationType": "jwt",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "mysql",
"searchEngine": false,
"messageBroker": "kafka",
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSocialSignIn": false,
"enableSwaggerCodegen": false,
"jwtSecretKey": "4166646bfabd18ccec24a2d10d5b15229ba3fae4",
"clientFramework": "angularX",
"useSass": false,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"testFrameworks": [
"gatling"
],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "zh-cn",
"languages": [
"zh-cn"
]
}
}
i changed the "jhipsterVersion": "4.14.3" to 4.14.4 and update the project :
jhipster upgrade
Using JHipster version installed globally
Executing jhipster:upgrade
Options:
Welcome to the JHipster Upgrade Sub-Generator
This will upgrade your current application codebase to the latest JHipster version
Looking for latest generator-jhipster version...
yarn info v1.6.0
4.14.4
Done in 0.29s.
events.js:182
throw er; // Unhandled 'error' event
^
Error: ERROR! No update available. Application has already been generated with latest version.
at Environment.error (/usr/local/Cellar/jhipster/4.14.4/libexec/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:157:40)
at module.exports.error (/usr/local/Cellar/jhipster/4.14.4/libexec/lib/node_modules/generator-jhipster/generators/generator-base.js:2064:18)
at shelljs.exec (/usr/local/Cellar/jhipster/4.14.4/libexec/lib/node_modules/generator-jhipster/generators/upgrade/index.js:163:30)
at /usr/local/Cellar/jhipster/4.14.4/libexec/lib/node_modules/generator-jhipster/node_modules/shelljs/src/exec.js:199:9
at ChildProcess.exithandler (child_process.js:262:7)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:927:16)
at Socket.stream.socket.on (internal/child_process.js:348:11)
at emitOne (events.js:115:13)
it seems that i should remove some directory,how can i resolve it
rm -rf node_modules
rm yarn.lock
jhipster
overrite package.json //choose yes
the remainder conflict file i choose y or n on my demaind
as a result:
jhipster --version
Using JHipster version installed locally in current project's node_modules
4.14.4
Related
I can't find a way to fix this. It is working locally as usual. I have tried using path aliases, relative paths, updating the yaml file many times, but can't find it to work.
The gihub actions spits this
Run yarn build yarn run v1.22.19 warning package.json: No license field $ tsc Error: src/application/Feed/Activity/AddActivity.handler.ts(7,37): error TS2307: Cannot find module '#domain/Feed/Activity/Dto/Activity.response.dto' or its corresponding type declarations. Error: src/domain/Feed/Activity/Activity.mapper.ts(2,37): error TS2307: Cannot find module './Dto/Activity.response.dto' or its corresponding type declarations. Error: src/infrastructure/Serverless/Controller/Feed/Activity/AddActivity.controller.ts(4,37): error TS2307: Cannot find module '#domain/Feed/Activity/Dto/Activity.response.dto' or its corresponding type declarations. Error: src/infrastructure/Serverless/GetStream/Feed/Activity/Mapper/Activity.mapper.ts(6,37): error TS2307: Cannot find module '#domain/Feed/Activity/Dto/Activity.response.dto' or its corresponding type declarations. error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Error: Process completed with exit code 2.
this is my config
name: APP_NAME
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v3
with:
persist-credentials: false
- uses: actions/setup-node#v3
with:
node-version: lts/*
cache: yarn
- name: install
run: yarn --immutable
- name: build
run: yarn build
- name: Install B4A Cli
run: curl https://raw.githubusercontent.com/back4app/parse-cli/back4app/installer.sh | /bin/bash
- name: Configure B4A Cli and set it default
run: echo $ACCOUNT_KEY | b4a configure accountkey && b4a default $APP_NAME
- name: Deploy
run: b4a deploy
Package.json
{
"description": "",
"main": "src/main.js",
"scripts": {
"lint": "eslint src/",
"test": "jest",
"build": "tsc",
"dev:parse": "mongodb-runner start && parse-server --appId 'APP' --masterKey 'MASTER' --clientKey 'CLIENT' --databaseURI mongodb://localhost/test --cloud ./cloud/main.js",
"debug:parse": "mongodb-runner start && parse-server --appId 'APP' --masterKey 'MASTER' --clientKey 'CLIENT' --databaseURI mongodb://localhost/test --cloud ./cloud/main.js --verbose",
"dev:dash": "parse-dashboard --dev --appId APPLICATION_ID --masterKey MASTER_KEY --serverURL http://localhost:1337/parse --appName MY_APP"
},
"devDependencies": {
"#types/jest": "^29.2.3",
"#types/node": "^18.11.9",
"#types/node-fetch": "^2.6.2",
"#types/parse": "^3.0.1",
"#types/uuid": "^8.3.4",
"#typescript-eslint/eslint-plugin": "^5.42.1",
"#typescript-eslint/parser": "^5.42.1",
"eslint": "^8.27.0",
"jest": "^29.3.1",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
},
"dependencies": {
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"getstream": "^8.1.0",
"module-alias": "^2.2.2",
"parse-server": "^5.3.3",
"reflect-metadata": "^0.1.13",
"tsyringe": "^4.7.0",
"uuid": "^9.0.0"
},
"_moduleAliases": {
"#root": "cloud/",
"#domain": "cloud/domain",
"#application": "cloud/application",
"#infrastructure": "cloud/infrastructure"
}
}
tsconfig.json
{
"compilerOptions": {
"lib": ["es6"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"target": "ES2022",
"module": "commonjs",
"moduleResolution": "node",
"rootDir": "src/",
"baseUrl": ".",
"paths": {
"#root/*": ["./src/*"],
"#domain/*": ["./src/domain/*"],
"#application/*": ["./src/application/*"],
"#infrastructure/*": ["./src/infrastructure/*"],
},
"outDir": "cloud",
"removeComments": true,
"isolatedModules": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": false,
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictPropertyInitialization": false,
"alwaysStrict": true,
"skipLibCheck": true
},
"include": ["src/"],
"exclude": ["src/**/*.spec.ts", "cloud", "node_modules"]
}
I have tried changing the github actions yaml config, switching from relative paths to path aliases, but can't make it work.
Delete node_modules folder and run npm install. Hope this will work
Question Background
I'm trying to add Wallet Connect to our project(Vue.js), form here: https://docs.walletconnect.com/quick-start/dapps/web3-provider, I used this command to install it.
import it in my js file
import Web3 from 'web3'
import WalletConnectProvider from '#walletconnect/web3-provider'
it shows those errors:
ERROR Failed to compile with 7 errors
These dependencies were not found:
* crypto in ./node_modules/eth-lib/lib/bytes.js, ./node_modules/web3-eth-accounts/lib/index.js and 1 other
* http in ./node_modules/xhr2-cookies/dist/xml-http-request.js
* https in ./node_modules/xhr2-cookies/dist/xml-http-request.js
To install them, you can run: npm install --save crypto http https
Try
I install those packages.
npm i crypto-browserify
npm i https-browserify
npm i stream-http
Then edit my vue.config.js files:
resolve: {
fallback: {
crypto: require.resolve('crypto-browserify'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
},
},
and the errors becomes:
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
configuration.resolve has an unknown property 'fallback'.
These properties are valid:
object { alias?, aliasFields?, cachePredicate?, cacheWithContext?, concord?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
This is my package.json file look like:
{
"dependencies": {
"#walletconnect/web3-provider": "^1.7.8",
"crypto-browserify": "^3.12.0",
"https-browserify": "^1.0.0",
"os": "^0.1.2",
"stream": "^0.0.2",
"stream-http": "^3.2.0",
"vue": "^2.6.10",
"web3": "^1.7.3",
},
"devDependencies": {
"#vue/cli-service": "^3.7.0",
"webpack": "^4.39.3",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-dev-server": "^3.11.2",
"webpack-merge": "^4.2.1",
"webpack-node-externals": "^1.7.2",
"webpack-plugin-hash-output": "^3.2.1",
"webpack-spritesmith": "^1.0.1",
}
}
and my node version is v10.24.1, the version still can't be upgraded temporarily.
v10.24.1
As seen from the above, I have installed the suggested packages from the errors (crypto-browserify, stream-http, and https-browserify) and have included them in the vue.config.js.
How can I solve this?
You are using Webpack 4. The fallback option is only available from Webpack >=5.0.0 onwards.
For Webpack 4, consider using alias option.
I'm trying to move my service into a Docker container. Building the project works fine locally, but when I try building it as part of docker build, I get the following error:
node_modules/jest-extended/types/index.d.ts(135,39): error TS2694: Namespace 'jest' has no exported member 'Mock'.
Please find my dockerfile:
FROM node:12
COPY package.json /opt/service/
WORKDIR /opt/service/
RUN npm install
COPY . .
RUN npm run build
...
package.json parts that are relevant
"scripts": {
"build": "rm -rf lib && graphql-codegen && tsc -p tsconfig.json && copyfiles -u 1 ./src/**/*.graphql lib && copyfiles -u 1 ./src/**/*.proto lib"
},
"devDependencies": {
"#graphql-codegen/cli": "1.17.8",
"#graphql-codegen/typescript": "1.17.8",
"#graphql-codegen/typescript-resolvers": "^1.18.1",
"#types/jest": "^27.0.2",
"#types/node": "^16.10.2",
"copyfiles": "^2.3.0",
"graphql": "14.7.0",
"jest": "27.2.4",
"jest-cli": "27.2.4",
"jest-extended": "^0.11.5",
"nodemon": "^2.0.4",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.1",
"typescript": "^3.9.7"
},
tsconfig.json
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"lib": ["es2019", "dom"],
"strict": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"typeRoots": ["node_modules/#types"],
"esModuleInterop": true,
"resolveJsonModule": true,
"outDir": "lib",
"rootDir": "src",
"resolveJsonModule": true,
"allowJs": true
},
"ts-node": {
"transpileOnly": true,
"files": true
},
"include": ["**/*"],
"exclude": ["node_modules", "lib", "jest.*.ts", "jest.*.js", "**/generated/*"]
Edit:
Adding "skipLibCheck": true in my compilerOptions fixed the Namespace 'jest' has no exported member 'Mock' error.
I'm still getting errors though that I didn't mention before that I hoped would get resolved by fixing the first error.
The Errors I'm still getting from *.test.ts files are:
error TS2708: Cannot use namespace 'jest' as a value.
error TS2304: Cannot find name 'expect'.
error TS2304: Cannot find name 'beforeAll'.
error TS2582: Cannot find name 'test'.
I have an idea that maybe could resolve your issue, as I had a similar problem that was caused because of version conflicts. Could you try to also copy your package-lock.json file to your docker image?
...
COPY package.json /opt/service/
COPY package-lock.json /opt/service/
...
This turned out to be a problem with tsconfig.json and my folder structure. I have multiple services and packages in this project. In the root folder (two folders up from each service) I have a tsconfig.json file that other services and packages are extending. Because I'm only copying the tsconfig.json file from the root and not node_modules, and the root tsconfig.json file is declaring "typeRoots": ["node_modules/#types"], services expect #types to be found in ../../node_modules.
Net App and my issue is when I hit Rebuild it throws an error: Visual Studio 2017: The command "gulp" exited with code 9009
Full log you can see [here][1]
The short story:
Everything worked fine until yesterday, where I was updating python from 2.x to python3.
After that my global variable $(PATH) became instead of C:\Program Files\nodejs => C:\python39\
I edited $(PATH) and put it again C:\Program Files\nodejs into my external tools:
https://i.imgur.com/HtQkAYW.png
I also add as second location of external tools my %AppData% folder for npm as you can see on the image above. I checked that folder and there is a gulp cmd file. So it should be recognizable.
However when I hit rebuild, I still have this error as I shown from my logs.
This is my package.json file:
{
"name": "testtest",
"version": "1.0.0",
"private": true,
"scripts": {
"css": "gulp"
},
"engines": {
"node": "5.9.1",
"npm": "3.7.3"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-htmlclean": "^2.7.22",
"gulp-less": "^3.1.0",
"gulp-minify-css": "^1.2.4",
"gulp-sourcemaps": "^2.3.0",
"gulp-uglify": "^2.1.2",
"gulp-util": "^3.0.7",
"merge-stream": "^1.0.0"
}
}
This is mine setup of npm version from cli:
{
gulp: '3.9.1',
npm: '6.14.6',
ares: '1.16.0',
brotli: '1.0.7',
cldr: '37.0',
http_parser: '2.9.3',
icu: '67.1',
llhttp: '2.1.2',
modules: '72',
napi: '6',
nghttp2: '1.41.0',
node: '12.18.4',
openssl: '1.1.1g',
tz: '2019c',
unicode: '13.0',
uv: '1.38.0',
v8: '7.8.279.23-node.39',
zlib: '1.2.11'
}
I tried different versions of nodejs (12.x.x and 10.x.x) I have same behavior.
[1]: https://pastebin.com/4srU2yB0
I'm getting the error Node Sass version 6.0.1 is incompatible with ^4.0.0. when running yarn webpack (see full error below).
yarn webpack
yarn run v1.22.5
$ /var/www/app/node_modules/.bin/webpack
ERROR Failed to compile with 2 errors 11:00:43 AM
error in ./assets/app.scss 11:00:43 AM
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Node Sass version 6.0.1 is incompatible with ^4.0.0.
at getSassImplementation (/var/www/app/node_modules/sass-loader/dist/utils.js:77:13)
at Object.loader (/var/www/app/node_modules/sass-loader/dist/index.js:34:59)
error in ./assets/app.scss 11:00:43 AM
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Node Sass version 6.0.1 is incompatible with ^4.0.0.
at getSassImplementation (/var/www/app/node_modules/sass-loader/dist/utils.js:77:13)
at Object.loader (/var/www/app/node_modules/sass-loader/dist/index.js:34:59)
at processResult (/var/www/app/node_modules/webpack/lib/NormalModule.js:721:19)
at /var/www/app/node_modules/webpack/lib/NormalModule.js:827:5
at /var/www/app/node_modules/loader-runner/lib/LoaderRunner.js:399:11
at /var/www/app/node_modules/loader-runner/lib/LoaderRunner.js:251:18
at runSyncOrAsync (/var/www/app/node_modules/loader-runner/lib/LoaderRunner.js:156:3)
at iterateNormalLoaders (/var/www/app/node_modules/loader-runner/lib/LoaderRunner.js:250:2)
at Array.<anonymous> (/var/www/app/node_modules/loader-runner/lib/LoaderRunner.js:223:4)
at runCallbacks (/var/www/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:27:15)
at /var/www/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:200:4
at /var/www/app/node_modules/graceful-fs/graceful-fs.js:123:16
Entrypoint js/app [big] 2.74 MiB = runtime.js 14.8 KiB vendors-node_modules_symfony_stimulus-bridge_dist_index_js-node_modules_bootstrap_dist_js_boo-d06387.js 2.03 MiB js/app.css 40 KiB js/app.js 674 KiB
Entrypoint _tmp_copy 14.8 KiB (85.7 KiB) = runtime.js 15 auxiliary assets
webpack compiled with 2 errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
package.json
{
"devDependencies": {
"#fortawesome/fontawesome-free": "^5.12.0",
"#symfony/stimulus-bridge": "^2.0.0",
"#symfony/webpack-encore": "^1.0.0",
"bootstrap": "^4.4.1",
"core-js": "^3.6.5",
"file-loader": "^6.0.0",
"node-sass": "^6.0.1",
"popper.js": "^1.16.1",
"regenerator-runtime": "^0.13.2",
"sass-loader": "^9.0.1",
"stimulus": "^2.0.0",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
},
"dependencies": {
"jquery": "^3.4.1"
}
}
node -v
v16.4.1
yarn -v
1.22.5
yarn webpack -v
webpack 5.54.0
webpack-cli 4.8.0
webpack-dev-server 4.2.1
composer.json
{
"name": "symfony/website-skeleton",
"type": "project",
"license": "MIT",
"description": "A skeleton to start a new Symfony website",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": "^8.0.3",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "*",
"doctrine/doctrine-bundle": "^2",
"doctrine/doctrine-migrations-bundle": "^3",
"doctrine/orm": "^2",
"knplabs/knp-snappy-bundle": "^1.7",
"league/csv": "^9.7",
"omines/datatables-bundle": "^0.5.1",
"select2/select2": "^4.0",
"sensio/framework-extra-bundle": "^6.1",
"sideclick/bootstrap-modal-bundle": "^1.2",
"stof/doctrine-extensions-bundle": "^1.3",
"symfony/asset": "*",
"symfony/console": "*",
"symfony/dotenv": "*",
"symfony/expression-language": "*",
"symfony/flex": "^1.3.1",
"symfony/form": "*",
"symfony/framework-bundle": "*",
"symfony/http-client": "*",
"symfony/intl": "*",
"symfony/mailer": "5.3.*",
"symfony/messenger": "5.3.*",
"symfony/monolog-bundle": "^3.1",
"symfony/process": "*",
"symfony/security-bundle": "*",
"symfony/serializer-pack": "*",
"symfony/translation": "*",
"symfony/twig-pack": "*",
"symfony/validator": "*",
"symfony/web-link": "*",
"symfony/webpack-encore-bundle": "^1.12",
"symfony/yaml": "*",
"symfonycasts/reset-password-bundle": "^1.1",
"twig/string-extra": "^3.3"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.3",
"friendsofphp/php-cs-fixer": "^2.16",
"psalm/plugin-symfony": "^2.2",
"symfony/debug-pack": "*",
"symfony/maker-bundle": "^1.0",
"symfony/profiler-pack": "*",
"symfony/test-pack": "*",
"vimeo/psalm": "^4.6"
},
"config": {
"platform": {
"php": "8.0.3"
},
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"require": "5.3.*",
"allow-contrib": false
}
}
}
Error resolved after updating sass-loader from 9.0.1 to 12.1.0.
Solution: use sass instead
node-sass has now been deprecated. You can simply fix this by installing sass.
You can uninstall the old and install the new one as follows.
npm uninstall node-sass
npm install sass
It works all the same, with no other changed needed.
But if you want to use node-sass anyways You can you can install the right version based on your node.js version as follows
npm uninstall node-sass
npm install node-sass#4.14.1
You can choose your version number based on the following table, based on the node version you have installed, which you can check by the command node --version
I hope it helps you