require

React Native 'require' gotcha? Works for local image file, but not csv file in same directory

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: a React Native newbie here. Inside my component (inside by App.js file), I'm declaring a variable and setting it to a local CSV file, using require( ) . This errors ---> componentWillMount () { var csvFilePath = require ( './assets/imagesdata.csv' ); However, when I set this to the CSV I want, it gives me an error: Unable to resolve ./ assets / imagesdata . csv " from " . //App.js`: The module `./assets/imagesdata.csv` could not be found" The curious thing is this: if I just sub out the CSV file for another file in the same

TypeError: .find(…) is not a function nodejs mongoose

匿名 (未验证) 提交于 2019-12-03 01:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on samples in nodejs. I am struck with TypeError: Cars.find(...) is not a function at D:\Karthikeyan\rest-server\routes\carsRouter.js:19:15 when i try to access http://localhost:3000/cars . thanks App.js var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var mongoose = require('mongoose'); var url = 'mongodb://localhost:27017/myTest'; mongoose.connect(url); var

Webpack Dev Server (webpack-dev-server) Hot Module Replacement (HMR) Not Working

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have gone through many answers on StackOverflow & on GitHub issues as well but, I am still stuck in Hot Module Replacement in Webpack. I am using npm start to run my server with webpack-dev-server --hot --inline . I am trying to change code in my React component, but nothing happens in the browser . I am using Google Chrome Version 49.0.2623.87 (64-bit) on Ubuntu 14.04LTS. In my browser console , I am getting log messages as [HMR] Waiting for update signal from WDS... [WDS] Hot Module Replacement enabled. But, no hot/live reload is

TS2304: cannot find name require and process

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I want to start my angular 2 app using "npm start". I get errors: I tried a lot of "solutions" from internet, but nothing works. My versions: npm - 4.1.2 typings - 2.1.0 node - 7.5.0 tsconfig.json { "compilerOptions": { "target": "es6", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es2015", "dom"], "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true } } polyfills.ts import 'core-js/es6'; import 'core-js/es7/reflect'; require('zone.js

cannot load such file ― 1.9/bcrypt_ext (LoadError)

匿名 (未验证) 提交于 2019-12-03 01:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Hey I get the following Error when i try to start the rails server Any ideas? At the moment no possible solution worked... By the way I run Windows 8... might be the problem at all :D C : /RailsInstaller/ Ruby1 . 9.3 / lib / ruby / gems / 1.9 . 1 / gems / activesupport - 3.2 . 11 / lib / active_support / dependencies . rb : 251 : in `require': cannot load such file -- 1.9/bcry pt_ext (LoadError) from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in ` block in

Rails 4 - Bootstrap date picker

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a rails 4 app which I use with bootstrap and simple form. I'm trying to follow this tutorial so that i can have a single click date picker instead of separate date, month and year fields. https://learningnewtricks.wordpress.com/2013/07/03/bootstrap-date-picker-on-rails-so-simple/ I have implemented all of the steps in this tutorial, but nothing changes in the date picker. I have: gemfile: gem 'bootstrap-datepicker-rails' application.js @import "bootstrap-sprockets"; @import "bootstrap"; //= require underscore //= require gmaps/google

NPM Grant OAuth Middleware “invalid_redirect” error

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have been trying to use this elegant looking package to authenticate with Jawbone API. But I keep getting this error - I have configured my "app" with the Jawbone API service to use these Redirect URIs - My config file looks like this - module.exports = { 'server': { 'protocol' : 'https', 'host' : 'localhost', 'port' : 5000, 'callback' : '/done', 'transport' : 'session', 'state' : true }, 'jawbone' : { 'key' : '6f*********', 'secret' : '9b************************', 'callback' : '/connect/jawbone/callback', 'scope' : ['basic_read', 'sleep

Sequelize Issue By Separating Model Logic from Model Configuration

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am following the sequelize best practices by connecting to a host and importing all models into one file and then calling that file when interacting the model. For some reason it looks like this is causing an issue as I am getting an error at using the define method for the sequelize variable and I ran a test with a file that contained both logic together and I was able to add a user. Error: TypeError: Cannot read property 'define' of undefined at new module.exports (/Users/user/Desktop/Projects/node/ann/app/models/ann-model.js:3:27) at

'jquery is not defined' when using webpack to load bootstrap

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am just starting to learn to use Webpack (previously I just use the manual way to include individual scripts separately). And I used bootstrap-loader for loading bootstrap. Here is my webpack.config.js var path = require ( "path" ) var webpack = require ( 'webpack' ) var BundleTracker = require ( 'webpack-bundle-tracker' ) module . exports = { context : __dirname , entry : './assets/js/index' , // entry point of our app. assets/js/index.js should require other js modules and dependencies it needs output : { path : path . resolve

RangeError: Invalid status code: 0

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am having an issue where I am getting the following error code when attempting a POST request on this application (bearing in mind I am a beginner node.js/js programmer): Error: [ 20 : 22 : 28 ] [ nodemon ] starting `node app.js` Running server on 3000 Mon , 27 Jun 2016 19 : 22 : 31 GMT express deprecated res . send ( status , body ): Use res . status ( status ). send ( body ) instead at routes\edit . js : 35 : 25 c : \Users\Matt\WebstormProjects\ghs_restart\node_modules\mongodb\lib\utils . js : 98 process . nextTick ( function (