How can I display the current app version from package.json to the user using Vite?

For React & TypeScript users: Add a define to your vite.config.ts: import react from ‘@vitejs/plugin-react’; import { defineConfig } from ‘vite’; export default defineConfig({ plugins: [react()], define: { APP_VERSION: JSON.stringify(process.env.npm_package_version), }, }); If you haven’t got one already, define a vite-env.d.ts or env.d.ts and add a declare: declare const APP_VERSION: string; You’ll now be able … Read more

Use Bootstrap icons with NPM

Additional 28 June 2021 after import using NPM you can import CSS file to react with : import “bootstrap-icons/font/bootstrap-icons.css”; and use like this : <i className=”icon bi-envelope”></i> if you only want to use the bootstrap-icons.svg from node_modules, you can copy it manually or with webpack. If you copy in root folder, you can use like … Read more

Warning in npm config at latest version

Alternatively, edit your .npmrc file and change “init.author.name” to “init-author-name”. For me, the full list of keys I had to change (replace . with -) was: Old key New key ======= ======= init.author.name init-author-name init.author.email init-author-email init.author.url init-author-url init.license init-license The error/suggested fix returned was not helpful: npm WARN config init.author.email Use `–init-author-email` instead. npm … Read more

Yarn run multiple scripts in parallel

There is a difference between using & and &&. Using & will run scripts in parallel, using && will run scripts one after the other. package.json: { “parallel”: “yarn script1 & yarn script2”, “serial”: “yarn script1 && yarn script2”, “script1”: “… some script here”, “script2”: “… some there script here” }

-bash: sequelize: command not found

The reason is: sequelize is not installed globally on your cli. To get sequelize access to all your cli just do. npm install -g sequelize-cli The ‘-g’ means global this will allow you to access sequelize command anywhere in your app directory. After that you can do eg: sequelize model:generate –name User –attributes firstName:string,lastName:string,email:string,password:string

NPM: how to specify registry to publish in the command line?

There’s multiple ways to accomplish this. use npm config to set the registry globally: npm config set registry http://nexus.dsv.myhost/nexus/repository/npmjs use npm config to set the registry for the package scope: npm config set @<your scope here>:registry http://nexus.dsv.myhost/nexus/repository/npmjs configure your package.json with a publish config: { … “publishConfig”: { “registry”: “http://nexus.dsv.myhost/nexus/repository/npmjs” }, … } use npmrc … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)