package.json

How to start Gulp watch task when I type npm start

。_饼干妹妹 提交于 2019-12-04 17:41:40
问题 I have a gulp.js file that includes: gulp.task('default', ['watch']); Which starts up the watch task gulp.task('watch', function(){ gulp.watch(productionScripts, ['autoConcat']); }); Then on any saved changes to files in productionScripts, the watch task will concat the files. What I would like to do, is in my package.json, I would like to spool up this watch when I type npm start (this already starts my node server). package.json "start": "node server.js", UPDATE -------- Ben(b3nj4m.com), I

What is the point of putting npm's “package-lock.json” under version control?

我的梦境 提交于 2019-12-04 15:37:34
问题 What is the point of putting npm's package-lock.json under version control? In my experience having this file source controlled has caused more trouble and confusion than efficiency gains. Having package-lock.json under source control makes for a major headache every time a developer who added/removed/modified any node modules needs to resolve conflicts between branches. Especially working on a complex/large apps where the package-lock.json can be tens of thousands of lines long. Even just

“Uncaught TypeError: React.createClass is not a function” in Render.js file (electron app)

蓝咒 提交于 2019-12-04 13:21:50
问题 I'm new to react.js and I am trying to get this code to replace one line in an html file inside an electron app with whatever is in return inside the MainInterface variable This is my Render.js File var React = require('react'); var ReactDOM = require('react-dom'); var $ = jQuery = require('jquery'); var bootstrap = require('bootstrap'); //var createReactClass = require('create-react-class'); var MainInterface = React.createClass({ render: function() { return( <h1>SUCCESSSSSSSSSSS</h1> ); }/

Change working directory for npm scripts

天大地大妈咪最大 提交于 2019-12-04 08:46:25
问题 Q: Is it possible to change the the context in which npm runs scripts? What I want to is the following: "scripts": { "test": "gulp mocha", "pre-install": "./deps/2.7/cpython/configure --prefix=$(pwd)/build --exec-prefix=$(pwd)/build && make -C deps/2.7/cpython && make -C deps/2.7/cpython install", "install": "node-gyp rebuild" }, Obviously cd deps/2.7/cpython/ && ./configure would work on UNIX-like systems but not on windows. Why: The root of the problem is, that the configure command of the

Angular 2 required libraries

▼魔方 西西 提交于 2019-12-04 08:41:28
问题 I would like to start working with the Angular2 Beta, but I am facing a few problems regarding the required libraries. I am using Eclipse and it's TypeScript Plugin. Also, I am using SystemJS as module loader. My problem is that if I install Angular2 using npm install angular2 it loads the whole Angular-Project, including the CommonJS -Version, ES6 -Version and the TypeScript -Version. This results in a over 30 MB big folder with almost 2000 files, though I only need the TypeScript -Version

Get value of package.json in gitLab CI YML

坚强是说给别人听的谎言 提交于 2019-12-04 03:04:16
I'm using gitLab CI for my nodejs application. In my YML file I need to call a script to build a docker image. But instead of using latest I need to use the current version of the project. This version value can be find in the package.json file of the repository. Is it possible to read the version value of the package.json file to replace latest by the current version? # ... variables: CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest # need version value instead of latest build: stage: build script: # ... - cd /opt/core/bundle && docker build -t $CONTAINER_RELEASE_IMAGE . - docker push

Define private registry in package.json

末鹿安然 提交于 2019-12-04 02:07:52
We have a private npm repository based on Sinopia What should I define in package.json that some packages will be installed from Synopia rather then from global npm repository? If I install it from command line I can run: npm install <package_name> --registry <http://<server:port> P.S. tried to google and looked in official NPM documentation but have found nothing. One of the method i know that is by .npmrc You can also use .npmrc also inside the project set configuration like this registry = http://10.197.142.28:8081/repository/npm-internal/ init.author.name = Himanshu sharma init.author

Heroku does not read node version

放肆的年华 提交于 2019-12-04 00:03:49
I have a Node project that I want to host on Heroku. I have explicitly defined node and npm versions in my package.json (located in the root directory), which looks like this: { "name": "*********", "version": "0.0.0", "private": true, "engines": { "node": "0.12.x", "npm": "2.5.x" }, "scripts": { "start": "node ./bin/www" }, "dependencies": { "body-parser": "^1.13.3", ... } However, when I try to push the app to heroku git push heroku master Heroku tries to build the app, but seems not to be able to reed the node and npm version. Here is the response i get. remote: -----> Installing binaries

how to Add my node_module, modules into package.json

谁说胖子不能爱 提交于 2019-12-03 23:43:07
I have some module in my node_module folder but because I am amateur in nodejs , when I wanted to install theme, I forgot to use --save with npm install .now I have lots of module but my package.json is empty so is there any way to add theme into package.json . Sorry if my question is silly one I am beginner in nodejs Simply change into the directory containing node_modules , backup any existing package.json in there, then use npm init to re-create the package.json . The generated package.json will include any modules that already exist within node_modules . Sample run: $ cd /my/project $ mv

Angular5 :polyfills.ts & \\main.ts is missing from the TypeScript compilation

冷暖自知 提交于 2019-12-03 23:25:55
This is my Angular5 project structure. Both tsconfig.app.json and package.json contain this section "include": [ "/src/main.ts", "/src/polyfills.ts" ] But no matter what I try I still get this error: \polyfills.ts & \main.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. Anyone has idea what's missing here? tsconfig.json { "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators":