package.json

Wait seconds before running next task on scripts package.jscon

纵饮孤独 提交于 2019-12-23 09:15:33
问题 What I want to do is when I run npm run dev to execute those both tasks I need to wait for 5 seconds until next task runs. Run the npm run server wait for 5 seconds and then npm run client "scripts": { "start": "node ./bin/www", "server": "nodemon start", "client": "gulp", "dev": "concurrently 'npm run server' 'npm run client'", } 回答1: Assuming you're on Linux, you can use sleep command: "dev": "concurrently 'npm run server' 'sleep 5 && npm run client'" 回答2: Adding to @TGrif answer, chain

How to resolve authentication error in npm install?

我与影子孤独终老i 提交于 2019-12-22 17:49:57
问题 In my package.json I have private repo called somerepo.git. Now I am running an npm install on a buildserver(bamboo) through maven and getting this error: [ERROR] npm ERR! Command failed: git clone --template=/var/home/ci/.npm/_git-remotes/_templates --mirror https://somerepo.git [ERROR] npm ERR! fatal: Authentication failed for https://somerepo.git How can I resolve the authentication for the repository? 回答1: If you can, you should: access the private repo through ssh use a deploy or trusted

How to specify browserify extensions in package.json?

半城伤御伤魂 提交于 2019-12-22 10:20:03
问题 In package.json: ... "browserify": { "transform": [ "coffee-reactify" ], "extension": [ ".cjsx", ".coffee", ".js", ".json" ], "extensions": [ ".cjsx", ".coffee", ".js", ".json" ] }, ... When using browserify transform option works as expected, however browserify is not seeing extension(s) options - it throws error and I have to pass extension options manually to browserify... in gulpfile.coffee b = browserify entries: './' # ./ = root = directory where package.json is debug: true b.bundle()

What are these properties prefixing underscore used for in package.json?

走远了吗. 提交于 2019-12-22 06:36:17
问题 I found these properties prefixing underscore in package.json. What are they used for? why prefixing underscore on properties? "_from": "react-scripts@0.9.3", "_id": "react-scripts@0.9.3", "_inCache": true, "_location": "/react-scripts", "_nodeVersion": "6.0.0", "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/react-scripts-0.9.3.tgz_1488303928068_0.6415497597772628" }, "_npmUser": { "name": "gaearon", "email": "dan.abramov@gmail.com" }, 回答1: Those are

Why does Electron need to be saved as a developer dependency?

人走茶凉 提交于 2019-12-21 07:19:10
问题 As per the official website, the correct way to save electron files is: npm install electron --save-dev Electron is actually required for running the app (quite literally: require() ) and this goes against the top voted answer here. So why do we make this exception, if this is even one? 回答1: The fact that you require a package is irrelevant to whether it should be considered a dependency or a devDependency (in the npm sense). E.g. many projects use webpack API (i.e. const webpack = require(

How to run typescript compiler as a package.json script without grunt or gulp

不羁的心 提交于 2019-12-21 03:11:23
问题 I don't want to use grunt or gulp to compile ts files. I just want to do it in my package.json something like this: "scripts": { "build": "tsc main.ts dist/" }, is it possible? 回答1: "build": "tsc main.ts dist/" Highly recommend you use tsconfig.json and then the -p compiler option to build your code. Look at: Compilation-Context Setup Here is the setup for using tsc with NPM scripts init npm init npm install typescript --save And then in your package.json add some scripts : "scripts": {

Import from subfolder of npm package

℡╲_俬逩灬. 提交于 2019-12-20 12:09:03
问题 I've been working on creating a small library of React components for use in several other projects. I am publishing the package internally (using a private GitHub repository) and then including in another project. However, when I go to import from a subdirectory of the package I am not able to do so as the paths don't match. The projects using the package all utilize webpack to bundle/transpile code as I am trying to avoid doing any building in the component library if possible. Directory

Deploy Angular 5 + Nodejs Express app to Heroku

六月ゝ 毕业季﹏ 提交于 2019-12-20 11:34:18
问题 I have an Angular 5 App. This is what I have in my package.json { "name": "web", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "node server.js", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "postinstall": "ng build --aot --prod" }, "private": true, "dependencies": { "@angular/animations": "5.1.0", "@angular/cli": "^1.6.4", "@angular/common": "5.0.3", "@angular/compiler": "5.0.3", "@angular/compiler-cli": "5.0.3", "@angular/core": "5.0.3

How can I reference package version in npm script?

允我心安 提交于 2019-12-20 09:22:07
问题 I want to reference my package version in a npm script so I can show current version in the app. Something like { "name": "bla", "version": "1.0.0", "author": "bla bla", "scripts": { "build": "node VERSION=<<package.version>> build/build.js" } } Is there a way to do this? 回答1: 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",

How to configure package.json to run eslint script

。_饼干妹妹 提交于 2019-12-20 09:13:51
问题 So I am using eslint as a linter for my react project and I would like it to check all of my .js files. I am able to do this through the script: "lint": "eslint back/*.js && eslint backTest/*.js && eslint front/actions/*.js" how can I get it to examine every .js file recursively, something like: "lint": "eslint -r *.js" This would save me having to type out each file inidvidually Thanks in advance for the help 回答1: eslint "**/*.js" to run on all js files in all the folders recursively (in the