node-modules

Importing Sass through npm

谁说我不能喝 提交于 2019-11-28 22:06:28
问题 Currently in our Sass files we have something like the following: @import "../../node_modules/some-module/sass/app"; This is bad, because we're not actually sure of the path: it could be ../node_modules , it could be ../../../../../node_modules , because of how npm installs stuff. Is there a way in Sass that we can search up until we find node_modules? Or even a proper way of including Sass through npm? 回答1: If you are looking for a handy answer in 2017 and are using Webpack, this was the

npm WARN install Refusing to install hapi as a dependency of itself

◇◆丶佛笑我妖孽 提交于 2019-11-28 21:03:25
I tried to do the following (per instructions from official site ): mkdir hapi && cd hapi npm init npm install hapi --save But this gives me an error like this: npm WARN install Refusing to install hapi as a dependency of itself Now, I made a new test folder called hapiTest and repeated the commands and then everything worked fine. I tried the same process with a folder gulp and npm install gulp --save , and got the same error, so my conclusion is that I can't have the name of the folder be the same as the package that I want to install, but can someone back this statement up with some

Install node_modules inside Docker container and synchronize them with host

喜你入骨 提交于 2019-11-28 17:05:45
问题 I have the problem with installing node_modules inside the Docker container and synchronize them with the host. My Docker's version is 18.03.1-ce, build 9ee9f40 and Docker Compose's version is 1.21.2, build a133471 . My docker-compose.yml looks like: # Frontend Container. frontend: build: ./app/frontend volumes: - ./app/frontend:/usr/src/app - frontend-node-modules:/usr/src/app/node_modules ports: - 3000:3000 environment: NODE_ENV: ${ENV} command: npm start # Define all the external volumes.

Best node.js module for finding location? [closed]

那年仲夏 提交于 2019-11-28 15:58:22
I had found couple of node.js modules for finding the information about client location and network using ip address. Requirements: Location - country, city, state, latitude, longitude etc. Network - Internet service Provider, Internet connection type and internet speed etc. Data Accuracy - maximum possibility. Note: Looking for server side solution. The above mentioned modules uses maxmind data . And i had read about the maxmind data accuracy as well. I am little confused to choose the above node.js modules and i like to know is there any better node.js frameworks available for finding

How to fix 'fs: re-evaluating native module sources is not supported' - graceful-fs

﹥>﹥吖頭↗ 提交于 2019-11-28 15:50:01
Recently I've made a switch to Node v.6, and It started creating more and more problems with running normal builds grunt/gulp/webpack For example: $ gulp [14:02:20] Local gulp not found in ~/_Other/angular-2-ts/angular2-seed [14:02:20] Try running: npm install gulp while gulp and all other plugins and modules are installed (and even re-installed via rm -rf node_modules ) in /node_modules folder. Most of those errors have line like (node:42) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. with 42 as

Npm install failed with “cannot run in wd”

老子叫甜甜 提交于 2019-11-28 15:33:47
问题 I am trying to get my node environment set up on a new Ubuntu 12.04 instance, with Node 0.8.14 already installed, but I ran into problems when I try to run npm install . So when I try npm install , it says that I need to run it as root or adminisrator: Error: EACCES, mkdir '/usr/local/lib/node_modules/coffee-script' npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/coffee-script'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/usr/local/lib/node_modules/coffee-script

Require dependency of another dependency in node modules

霸气de小男生 提交于 2019-11-28 11:52:50
I've got a simple node app that has single dependency on another app on github. The dependency installs just fine with npm install , but when I try to require something installed there, it says it's not available. For example, the github app installs Mongoose as a dependency. I thought that this parent app would be able to access that module since it is in a child: var mongoose = require('mongoose') The structure looks something like this: /app /node_modules /github_dependency [parent module] /node_modules /mongoose [child module] Do I just have to include mongoose as a dependency as well in

“style” field in package.json

南楼画角 提交于 2019-11-28 10:52:06
I noticed that Bootstrap and Normalize.css both have a "style" field in their package.json. Why do they have this? If I had to guess, it's to allow users to import the defined stylesheet as easily as doing require('bootstrap') , but that doesn't seem to be the case. From Techwraith's pull request that added it to Bootstrap: Many modules in npm are starting to expose their css entry files in their package.json files. This allows tools like npm-css , rework-npm , and npm-less to import bootstrap from the node_modules directory. [...] It's actually not written anywhere but in the code for these

Phonegap/Cordova build android node_modules/q/q.js throw e;

南笙酒味 提交于 2019-11-28 08:08:28
cordova build android gives me the following err node_modules/q/q.js:126 throw e; (*error details) This question has been asked before, but the typical answer regarding PATH and ANDROID_HOME hasn't worked for me. I've put this into code snippet to avoid SO submission problems export HOME="/Users/rover" export ANDROID_SDK="$HOME/Documents/Dev/Android/adt-bundle-mac-x86_64-20140702/sdk" export ANDROID_HOME="$ANDROID_SDK/tools" export ANDROID_PLATFORM_TOOLS="$ANDROID_SDK/platform-tools" export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$ANDROID_SDK/build-tools:$PATH" export ANT_HOME="/usr/local

How to provide a mysql database connection in single file in nodejs

故事扮演 提交于 2019-11-28 03:28:01
I need to provide the mysql connection for modules. I have a code like this. var express = require('express'), app = express(), server = require('http').createServer(app); var mysql = require('mysql'); var connection = mysql.createConnection({ host : '127.0.0.1', user : 'root', password : '', database : 'chat' }); connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); return; } }); app.get('/save', function(req,res){ var post = {from:'me', to:'you', msg:'hi'}; var query = connection.query('INSERT INTO messages SET ?', post, function(err, result) { if