Build .exe file in .NET Core RC2

There are actually 2 app models in .NET Core: Portable apps: heavily inspired by “DNX console apps”, these apps don’t produce .exe files and are instead executed by the .NET Core shared runtime (whose version is defined by the Microsoft.NETCore.App package, thanks to its special type: platform attribute). The corresponding .NET Core runtime must be … Read more

How can I reference package version in npm script?

1) Referencing package version in npm-scripts. In npm-script‘s you can reference the version using the variable npm_package_version. For example: Using a bash shell (E.g. Linux, macOS): { … “version”: “1.0.0”, “scripts”: { “build”: “echo $npm_package_version” } } Note the $ prefix Using Windows (E.g. cmd.exe, Powershell): { … “version”: “1.0.0”, “scripts”: { “build”: “echo %npm_package_version%” … Read more

“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 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

Running ‘npm audit fix –force’ downgrades react-scripts

One of the create-react-app maintainers has announced that they cannot fix this as the vulnerabilities affect transitive dependencies, and that it should not matter. The reasoning is that the npm audit feature was built with Node apps in mind, not build tools. Vulnerabilities in the dependencies should (in most cases) not translate to vulnerabilities in … Read more

npm equivalent of yarn resolutions?

Since NPM 8.3 the equivalent to yarn resolutions is called overrides. To make sure the package foo is always installed as version 1.0.0 no matter what version your dependencies rely on: { “overrides”: { “foo”: “1.0.0” } } Documentation: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides Why and how the feature was added it’s discussed in the RFC and discussion on … Read more

What is the “module” package.json field for?

Update: April 2022 The module field is not officially defined by Node.js and support is not planned. Instead, the Node.js community settled on package exports which they believe is more versatile. For practical reasons JavaScript bundlers will continue to support the module field. The esbuild docs explain when to use module as well as related … Read more

tech