wtfribley / angular-treemendous

Simple, flexible angular tree with grouping.
MIT License
6 stars 0 forks source link

Need example for browserify with npm module #1

Closed funkytaco closed 9 years ago

funkytaco commented 9 years ago

I don't know why this module isn't working when I try to use it with Angular and npm with Browserify. I can install any other module, require it in app.js, and it works. Here's my package.json:

{
  "name": "test",
  "version": "0.0.0",
  "description": "## Development \tnpm install -g bower json-proxy \tbower install",
  "main": "Gruntfile.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "None",
  "license": "ISC",
  "dependencies": {
    "angular": "1.2.23",
    "angular-bootstrap": "^0.12.0",
    "angular-module-resource": "1.2.19",
    "angular-resource": "0.1.1",
    "angular-route": "1.2.17-build.163.1",
    "angular-treemendous": "^0.2.3",
    "bootstrap": "^3.2.0",
    "gulp": "^3.8.7",
    "gulp-browserify": "^0.5.1",
    "gulp-concat": "^2.3.4",
    "gulp-jshint": "^1.9.0",
    "gulp-load-plugins": "^0.6.0",
    "gulp-webserver": "^0.7.0",
    "morgan": "^1.5.1"
  },
  "devDependencies": {
    "chai": "^1.9.1",
    "chai-as-promised": "^4.1.1",
    "mocha": "^1.21.4",
    "protractor": "^1.1.1"
  }
}

Here's app.js:

  var ngTreemendous = require('angular-treemendous');
  var app = angular.module('app', ['ngRoute', 'ngResource', 'ui.bootstrap','treemendous']);

Gulp browserify:

    gulp.task('browserify', ['lint', 'templates'], function() {
      var jsFiles = ['js/app.js'];
      gulp.src(jsFiles)
        .pipe(plugins.browserify({debug: true, insertGlobals: true}))
        .pipe(plugins.concat('bundle.js'))
        .pipe(gulp.dest(dest));
    });

I get an error saying: Error: module "angular-treemendous" not found from "/Users/myuser/my-webapp/js/fake_84520517.js"

The module is definitely installed. I've had two co-workers review and we can't find the problem.

wtfribley commented 9 years ago

Oops -- package.json was out of date. The "main" field should be "angular-treemendous.js"

I have limited internet access at the moment... I quickly committed the change, but it may take me a couple days to bump the version and publish to npm. In the meantime, just go in and change the "main" field in the angular-treemendous package.json and see if that fixes it...

paulpflug commented 9 years ago

+1 for a bump

wtfribley commented 9 years ago

Closing in favor of #2