“unexpected token import” in Nodejs5 and babel?

From the babel 6 Release notes: Since Babel is focusing on being a platform for JavaScript tooling and not an ES2015 transpiler, we’ve decided to make all of the plugins opt-in. This means when you install Babel it will no longer transpile your ES2015 code by default. In my setup I installed the es2015 preset … Read more

How to display the app version in Angular?

If you want to use/show the version number in your angular app please do the following: Prerequisites: Angular file and folder structure created via Angular CLI Steps for Angular 6.1 (TS 2.9+) till Angular 11 In your /tsconfig.json (sometimes also necessary in /src/tsconfig.app.json) enable the following option (webpack dev server restart required afterwards): “compilerOptions”: { … Read more

How do I add a custom script to my package.json file that runs a javascript file?

Custom Scripts npm run-script <custom_script_name> or npm run <custom_script_name> In your example, you would want to run npm run-script script1 or npm run script1. See https://docs.npmjs.com/cli/run-script Lifecycle Scripts Node also allows you to run custom scripts for certain lifecycle events, like after npm install is run. These can be found here. For example: “scripts”: { … Read more

Do I need both package-lock.json and package.json?

Do you need both package-lock.json and package.json? No. Do you need the package.json? Yes. Can you have a project with only the package-lock.json? No. The package.json is used for more than dependencies – like defining project properties, description, author & license information, scripts, etc. The package-lock.json is solely used to lock dependencies to a specific … Read more

How to use private Github repo as npm dependency

It can be done via https and oauth or ssh. https and oauth: create an access token that has “repo” scope and then use this syntax: “package-name”: “git+https://<github_token>:x-oauth-basic@github.com/<user>/<repo>.git” or ssh: setup ssh and then use this syntax: “package-name”: “git+ssh://git@github.com:<user>/<repo>.git” (note the use of colon instead of slash before user)

npm install private github repositories by dependency in package.json

Try this: “dependencies” : { “name1” : “git://github.com/user/project.git#commit-ish”, “name2” : “git://github.com/user/project.git#commit-ish” } You could also try this, where visionmedia/express is name/repo: “dependencies” : { “express” : “visionmedia/express” } Or (if the npm package module exists): “dependencies” : { “name”: “*” } Taken from NPM docs

Start script missing error when running npm start

It looks like you might not have defined a start script in your package.json file or your project does not contain a server.js file. If there is a server.js file in the root of your package, then npm will default the start command to node server.js. https://docs.npmjs.com/misc/scripts#default-values You could either change the name of your … Read more

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