package.json

What is purpose of the property “private” in package.json?

痴心易碎 提交于 2019-12-17 10:35:19
问题 I'm learning node.js and express, I am wondering what is the property "private" in ./package.json file used for? 回答1: Taken from this site, https://docs.npmjs.com/files/package.json#private private If you set "private": true in your package.json, then npm will refuse to publish it. This is a way to prevent accidental publication of private repositories. 来源: https://stackoverflow.com/questions/7314849/what-is-purpose-of-the-property-private-in-package-json

Build .exe file in .NET Core RC2

拜拜、爱过 提交于 2019-12-17 10:08:32
问题 Every time I build a project using the new .NET Core RC2 templates I am not provided with a runnable . EXE file. If I hit F5 for debugging my console application it runs fine through the C:\Program Files\dotnet\dotnet.exe application. And if I use the dotnet run command in the folder, it runs fine as well. But I see no way to run the application without the .NET Core CLI tools. The contents of my bin\Debug\netcoreapp1.0\ folder looks like this: As you can see there is no . EXE file available.

npm install private github repositories by dependency in package.json

风流意气都作罢 提交于 2019-12-17 02:17:09
问题 I'm trying to install github private repository by npm that includes other private github repositories as dependency. Have tried a lot of ways and posts but none is working. Here is what i'm doing : npm install git+https://github.com/myusername/mygitrepository.git in package.json is like : "dependencies": { "repository1name": "git+https://github.com/myusername/repository1.git", "repository2name": "git+https://github.com/myusername/repository2.git" } What is the the right way to do it? 回答1:

Node version error while deploying Angular2 app on Azure

杀马特。学长 韩版系。学妹 提交于 2019-12-13 17:16:59
问题 My package.json looks like copied below but I am getting error while deployment. I get the error: No available node.js version matches application's version constraint. Could anyone please tell whats the error. I have given this version as WEBSITE_NODE_DEFAULT_VERSION has the value 6.2.1. PFB the snapshot: package.json { "name": "angular-quickstart", "version": "1.0.0", "engines": { "node": "6.2.1" }, "description": "QuickStart package.json from the documentation, supplemented with testing

Node App works on Heroku Local but crashes on Heroku server. using simple Foundation template project

一世执手 提交于 2019-12-13 04:26:47
问题 I am trying to deploy a Foundation web app based on Yarn, Gulp and Node.js on Heroku. It works with heroku local web but crashes on the Heroku server. I have set the port correctly. I am trying to remove Browsersync and use gulp-connect instead. In my gulpfile.js I have set the connectHeroku task which is run after build. I have set the yarn start command in the environment for Heroku. Here is my gulp.babel.js : 'use strict'; import plugins from 'gulp-load-plugins'; import yargs from 'yargs';

Is it okay to include npm in devdependencies in package.json?

爷,独闯天下 提交于 2019-12-13 03:48:40
问题 I came across a nodejs repo that included npm in devdependencies. What would be the case that requires such config? Because, installing devdependencies already requires npm. 回答1: This makes sense if a repository uses NPM CLI internally and relies on specific NPM version instead of globally installed NPM, because the behaviour may be changed between major releases: devDependencies: { "npm": "^2" } While devDependencies: { "npm": "*" } won't make much sense, except that it will likely use

Custom git hook in package.json with husky

こ雲淡風輕ζ 提交于 2019-12-13 03:41:50
问题 I am trying to validate the commit message at commit. For that, I am using Husky and the commit-msg hook. However, as I also do commit message validation at build time, I want the validation code to be available in a separate JS file. So I am trying to call an external JS file to perform my commit validation. In my package.json file, I have: "commitmsg": "node validation.js" However, I cannot get the validation to be performed properly. Right now, validation.js looks like this: console.log(

Testing react components: Jest encountered an unexpected token

无人久伴 提交于 2019-12-12 17:19:06
问题 I am trying to test with Jest, but got an error: Jest encountered an unexpected token This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript. I have a photo gallery app and whenever I click on an image, a modal pops up with an image. I want to test that when I click on the image, the popup shows or exists. Is there a way to factor this? HERE IS MY CODE: import { shallow, mount, render } from 'enzyme'; import App from '../client/src

single quotes not working in package.json

此生再无相见时 提交于 2019-12-12 11:14:06
问题 I'd like to get my package.json to be able to run using the command npm run test-watch on Windows 10 with npm 5.5.1. In my package.json: "scripts": { "test": "mocha server/**/*.test.js", "test-watch": "nodemon --exec 'npm test'" } However, I this interpretes the code strangely to have a single quote in there. I'm actually following a Udemy course so it appears to work for the instructor. However, here is the output I get: PS D:\courses\node-course\node-todo-api> npm run test-watch > todo-api

typescript outDir setting in tsconfig.json not working

久未见 提交于 2019-12-12 09:29:35
问题 I can't seem to get the outDir flag working when used in package.json . Directory structure is pretty simple: tsconfig.json at the root level, together with a src/ directory and a single index.ts file plus other directories representing other modules. When running the tsc command on the index file, it creates a new one beside it instead of in the build directory. What am I doing wrong? My tsconfig: { "compilerOptions": { "outDir": "build" } } My npm build script: "build": "tsc src/index.ts" I