node-modules

Centralise node_modules in project with subproject

三世轮回 提交于 2019-12-03 04:25:13
问题 is it possible to configure grunt in a way that you have the required modules on a central point? I have following project structure -Project -- subproject -- subproject -- subproject I build the project via grunt with all subprojects, and I can build each subproject for itself too. Currently I have a Gruntfile.js, package.json & folder node_modules (~50mb) with all required modules in each subproject and on the root level. So is it possible to have the node_modules folder only on one level,

How to remove the global context from a nodejs module?

烈酒焚心 提交于 2019-12-03 04:03:12
Any thoughts on how one would go about removing the global context from a nodejs module? I'm not looking for a solution to the below problem, but if you need more context here you go. I'm working on a project where my users are able to upload their own nodejs modules and, if it fits a predefined framework, it will run on our at periodic times through out the day. Obviously this is a major security concern. A good 90% solution would simply be removing the global context. As stated in the comments, you really need to run user-supplied modules in a separate process because an infinite loop will

No version of composer-cli has been detected

笑着哭i 提交于 2019-12-03 04:01:31
All, After following the instructions in this page: Installing the Development Environment to install Hyperledger Composer, I encountered this error every time I use sudo ./createPeerAdminCard.sh I am sure that I have installed the correct version of composer-cli by executing these commands: npm install -g composer-cli@next or npm install -g composer-cli@0.19.0 Can someone advice what to do? FYI the correct Install Doc for v0.19.0 of Composer is here It looks like you are using sudo for some of the commands which may well be causing the problems. You should not need to use root or sudo. There

How to clean node_modules folder when prepping for deployment

老子叫甜甜 提交于 2019-12-03 03:54:00
How would I go about cleaning the node_modules folder when prepping my code for deployment. I am making an app using node-webkit and would prefer to include the least amount of files possible when bundling the final version of the app as the unzip process takes some time. I've looked at npm dedupe and use npm install --production to get rid of duplicates and fetch only production files, however I am still left with Readme files, benchmarks , tests and build files which I don't need. What I would like to end up with for each module in the node_modules folder is a LICENSE file if it exists, the

Install node.js modules in eclipse

人走茶凉 提交于 2019-12-03 03:01:44
I am trying to develop a chat app with node.js and socket.io in an eclipse environment. I have installed node.js in eclipse but I don't know how to install node modules such as expresss, socket io, etc. Please anyone tell me how to setup node modules in an eclipse environment. I dont think that there is an eclipse integrated way to do this. My suggestion is that you download node.js+npm from http://nodejs.org/download/ and then open up a terminal/cmd and in your node.js project directory do "npm install myPackage" From https://groups.google.com/forum/#!topic/nodeclipse/FgUci2ZXpoQ Double-click

Remove everything after last backslash

送分小仙女□ 提交于 2019-12-02 23:26:46
var t = "\some\route\here" I need "\some\route" from it. Thank you. You need lastIndexOf and substr ... var t = "\\some\\route\\here"; t = t.substr(0, t.lastIndexOf("\\")); alert(t); Also, you need to double up \ chars in strings as they are used for escaping special characters. Update Since this is regularly proving useful for others, here's a snippet example... // the original string var t = "\\some\\route\\here"; // remove everything after the last backslash var afterWith = t.substr(0, t.lastIndexOf("\\") + 1); // remove everything after & including the last backslash var afterWithout = t

have a new project but when ng serve i get error

旧时模样 提交于 2019-12-02 20:42:30
I need to change this topic, I cant post new topic. I have update the script, and install new package. I still get errors but not the one i post last. _ _ _ __ _ _ __ __ _ _ _ | | __ _ _ __ ___ | |(_) / _` || '_ \ / _` || | | || | / _` || '__|_____ / __|| || | | (_| || | | || (_| || |_| || || (_| || | |_____|| (__ | || | \__,_||_| |_| \__, | \__,_||_| \__,_||_| \___||_||_| |___/ angular-cli: 1.0.0-beta.26 node: 8.12.0 os: linux x64 @angular/animations: 6.1.9 @angular/cdk: 6.4.7 @angular/common: 6.1.9 @angular/compiler: 6.1.9 @angular/core: 6.1.9 @angular/forms: 6.1.9 @angular/http: 6.1.9

Centralise node_modules in project with subproject

泄露秘密 提交于 2019-12-02 17:38:56
is it possible to configure grunt in a way that you have the required modules on a central point? I have following project structure -Project -- subproject -- subproject -- subproject I build the project via grunt with all subprojects, and I can build each subproject for itself too. Currently I have a Gruntfile.js, package.json & folder node_modules (~50mb) with all required modules in each subproject and on the root level. So is it possible to have the node_modules folder only on one level, for e.g. on the root level and the subprojects refer to the node_modules on root level? -Project -

Delete node_modules folder recursively from a specified path using command line

风格不统一 提交于 2019-12-02 14:09:36
I have multiple npm projects saved in a local directory. Now I want to take backup of my projects without the node_modules folder, as it is taking a lot of space and can also be retrieved any time using npm install . So, I need a solution to delete all node_modules folders recursively from a specified path using the command line interface. Any suggestions/ help is highly appreciable. Darius M. Print out a list of directories to be deleted: find . -name 'node_modules' -type d -prune Delete directories from the current working directory: find . -name 'node_modules' -type d -prune -exec rm -rf '{

Angular 2 how to load 3rd party vendor node modules with sub dependencies angular-cli

别来无恙 提交于 2019-12-02 07:42:26
问题 Loading a single node module in Angular 2 an angular-cli bootstraped project is described within the wiki pretty well. Just being curious, how do I nicely load a more complex node module within a project bootstrapped with angular-cli? E.g. angular2-apollo relies on several sub-dependencies like apollo-client, graphql, lodash, ... I added the node module to angular-cli-build.js var Angular2App = require('angular-cli/lib/broccoli/angular2-app'); module.exports = function(defaults) { return new