node-modules

How to build nodejs C++ addon depending on a shared library with relative location

自闭症网瘾萝莉.ら 提交于 2019-12-04 16:28:58
I'm trying to build a node.js C++ using node-gyp but can't figure out how to specify the -Wl,-rpath,$ORIGIN so that when loaded from node it could find shared object library that is in the same directory as addon.node . I have tried setting my binding.gyp like this: "libraries": [ "-L../../install_release_x64/", "-llibppp" ], "ldflags": [ "-Wl,-rpath,'$ORIGIN'" ], "cflags_cc": [ "-fexceptions", "-fPIC", "-Wno-unknown-pragmas" ] but when I run $ readelf -d addon.node the result is like this: Dynamic section at offset 0x7d10 contains 29 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED)

Accessing node_modules after npm install inside Docker

心已入冬 提交于 2019-12-04 14:34:27
I am running Docker with Docker Machine on Mac. I successfully set up some containers and ran npm install inside them, as explained here . This installs the node_modules inside the image and inside the container, but they are not available on the host, i.e. my IDE complains about missing node_modules. Am I missing something? What is the best way to run npm install inside the container but be able to do development (with these dependencies) on the host? From my docker-compose.yml: volumes: - /Users/andre/IdeaProjects/app:/home/app - /home/app/node_modules Since you are using boot2docker , only

How to remove the global context from a nodejs module?

浪子不回头ぞ 提交于 2019-12-04 09:47:58
问题 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. 回答1: As stated in the

How to clean node_modules folder when prepping for deployment

旧巷老猫 提交于 2019-12-04 09:44:17
问题 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

typescript module resolution

左心房为你撑大大i 提交于 2019-12-04 05:32:46
Is there a typescript module resolution strategy that would allow me to have both local imports not starting with a slash and imports from node_modules in the same module? With "moduleResolution" set to "node" the compiler cannot find my local modules, with all other options it does not see the modules in node_modules directory I'm trying to import. I have the following imports in my file: import {Injectable} from "angular2/core"; import {Logger} from "core/logging/Logger"; "angular2/core" is located in node_modules, "core/logging/Logger" is my local module. I think that should be possible, if

gulp-order node module with merged streams

拥有回忆 提交于 2019-12-04 05:31:57
I'm using the gulp-order module along with the event-streams module and gulp-concat to concatenate javascript files into a single dest file. The gulp-order plugin has worked great for me in other projects where I wanted to concatenate files from the stream in a distinct order. For some reason in this project it is not working properly, and the files in the public/angular/config directory are dispersed amongst the files I specify to concatenate last in the public/js directory. I think this may have something to do with specifying multiply sources ie. the angular and js directories. I tried

Tslint and node-modules errors

送分小仙女□ 提交于 2019-12-04 05:26:13
问题 I am having problems with running tests of angular using jasmine or cucumber or whatever framework. The app is written in angular 5 that uses typescript and generated by JHipster. The result of running tests is this and it seems to last hours and hours in cmd without any change: C:\Users\67563478\new_workspace\onconsup123\src\test\javascript\spec>yarn test yarn run v1.5.1 $ npm run lint && karma start src/test/javascript/karma.conf.js > oncosup@0.0.0 lint C:\Users\67563478\new_workspace

node: could not initialize ICU (check NODE_ICU_DATA or --icu-data-dir parameters)

丶灬走出姿态 提交于 2019-12-04 02:53:59
问题 I was trying to upgrade node version on our CI environment from node 6 to node 8. I updated the full-icu version as well. the $NODE_ICU_DATA is set to /usr/lib/node_modules/full-icu but still get this error node: could not initialize ICU (check NODE_ICU_DATA or --icu-data-dir parameters) Any idea, how to fix this? 回答1: You need to run npm install including the full-icu package. It's full-icu 's postinstall step which downloads the appropriate bits for the currently executing node. Note that

How to change the Node.js module wrapper?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 23:18:40
For testing purposes I need to change the Node.js Module wrapper. (function (exports, require, module, __filename, __dirname, process, global) { debugger; }); Played around with Module I found var Module = require("module") Module.wrapper -> ["(function (exports, require, module, __filename, __dirname, process, global) { ", " });"] Module.wrap -> function(script) { return NativeModule.wrapper[0] + script + NativeModule.wrapper[1]; } Is it possible to hook into Module.wraper or property to change the script wrapping? You've done a great job by finding the Module.wrap function. How about simply

How does webpack resolve imports from node_modules?

吃可爱长大的小学妹 提交于 2019-12-03 22:31:04
When I need a library from my node_modules folder I do something like this: import angular from 'angular'; import $ from 'jquery; How does webpack know what file(s) it really has to import? Guess there's some kind of strategy what files it's going to check? Grgur Webpack loops over resolvers to find the file you requested. It goes over resolve templates to figure out the exact path. If you try to import a module that doesn't exist you'll see the error trace outlining all the paths it tried to use to find the file but failed. Resolvers are a powerful configuration tool that could help you