node-modules

React Native build error: Text must not be null or empty

寵の児 提交于 2019-12-10 04:37:01
问题 My Jenkins build has given me the following error: 13:18:22 FAILURE: Build failed with an exception. 13:18:22 13:18:22 * Where: 13:18:22 Script '/Users/abcd/Jenkins/Jenkins-Workspaces/ABCD/ABCDL/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 190 13:18:22 13:18:22 * What went wrong: 13:18:22 A problem occurred evaluating settings 'AppName'. 13:18:22 > Text must not be null or empty 13:18:22 It seems the problem is with the @react-native-community/cli

How to change the Node.js module wrapper?

隐身守侯 提交于 2019-12-09 14:18:07
问题 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

Cordova 4.3.0 - build command returns error Cannot find module 'Q'

最后都变了- 提交于 2019-12-09 06:07:43
问题 After updating cordova to version 4.3.0 the command: cordova build returns the following error: module.js:340 throw err; ^ Error: Cannot find module 'Q' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/Volumes/CaseSensitive/ios_projects/_Tests/testGruntCordova/testGruntCordova/platforms/ios/cordova/lib/check_reqs.js:25:13) at Module._compile (module.js

NPM - Failed to replace env in config: ${NPM_TOKEN}

风格不统一 提交于 2019-12-09 02:18:54
问题 I am trying to build a react app, but when I execute the command npm -i it gives me the following error: Error: Failed to replace env in config: ${NPM_TOKEN} at /usr/local/lib/node_modules/npm/lib/config/core.js:415:13 at String.replace (<anonymous>) at envReplace (/usr/local/lib/node_modules/npm/lib/config/core.js:411:12) at parseField (/usr/local/lib/node_modules/npm/lib/config/core.js:389:7) at /usr/local/lib/node_modules/npm/lib/config/core.js:330:24 at Array.forEach (<anonymous>) at Conf

Webpack load different modules based on chunk

微笑、不失礼 提交于 2019-12-08 16:05:22
问题 Is it possible to make webpack load another module based on some context information? For example I've two versions of my React application: desktop and mobile In my index.js I decide which application to load: if (isMobile()) { loadMobile().then(({default: App}) => render(App)) } Now I would like to reuse some modules, but some I would like to override it. So by default it should load index.js, but if the context isMobile and next to the index.js a mobile.js file exists, it should load the

require() node module from Electron renderer process served over HTTP

与世无争的帅哥 提交于 2019-12-08 16:03:22
问题 Typically, in an Electron app, you can require node modules from both the main process and the renderer process: var myModule = require('my-module'); However, this doesn't seem to work if the page was loaded via HTTP instead of from the local filesystem. In other words, if I open a window like this: win.loadURL(`file://${__dirname}/index.html`); I can require a node module without problems. But if I instead open a window like this: win.loadURL(`http://localhost:1234/index.html`); I no longer

Tell npm to look for node_modules inside a different dir

天大地大妈咪最大 提交于 2019-12-08 13:28:56
问题 npm looks for node_modules in the current directory, and all its parent directories, then looks in the global location. My current proposed dir structure is: global package.json node_modules/ project-1 gulpfile.coffee project-2 gulpfile.coffee But this isn't where npm normally looks for this. Is there an environment variable I can set to deal with this, or a way I can tell it to look in a specific directory? Thanks! 回答1: Try the following to set NODE_PATH in gulp. .pipe(preprocess({context: {

Determining Node modules location at runtime

半城伤御伤魂 提交于 2019-12-08 11:55:38
I am building a tool which is basically a node.js module. This tool can be installed globally (with -g option) I have few static files in the module to generate a report. If the module is invoked locally, I can refer to the static files with relative path ./node_modules/<module>/static/filename . But when the tool is invoked as a command, how do I refer to the static files? And how can I determine whether the tool is invoked as a local module or as a command? Use the magic variable __dirname. It refers to the directory containing your script file. http://nodejs.org/api/globals.html#globals

How do I use JSDoc type inference in WebStorm on a module with a dot in it's name? (Discord.js)

旧时模样 提交于 2019-12-08 10:56:31
问题 I'm trying to find a way to work with Discord.js TypeScript annotations using WebStorm's JSDoc type inference in a non-conflicting pattern. Here's what "works"... import Discord from 'discord.js'; /** * @param {Client} client * @param {Collection.<Snowflake, Message>} msgs */ function handleRemoveMessages(client, msgs) {} The problem is with Client, multiple definitions exist. While this works, I'd like to be able to namespace the imported types from the discord.js module into something like

TypeScript - “debugger;” statement does not work while working with QA Environment in Angular

元气小坏坏 提交于 2019-12-08 10:56:20
问题 I am working on a angular application with a setup of various environments. I am facing issues when I am trying set up some debug points using debugger; I am using ng serve -o --webconfiguration==qa to compile node_modules run the server. However, when I use ng serve -o debug points are hit. How do I set up my application to hit debug points while working with QA Environment Here's my configuration - Angular CLI Version - 7.3.8 Node Version - 10.15.3 NPM - 6.4.1 TypeScript - 3.1.6 angular