caolan / jam

JavaScript package manager - using a browser-focused and RequireJS compatible repository
MIT License
1.5k stars 105 forks source link

Fix bug when installing jam using NPM v3 #170

Open jpstevens opened 8 years ago

jpstevens commented 8 years ago

When using Jam with NPM v3, node_modules are stored at the top level, not recursively.

e.g.

NPM v2

.
└─┬ node_modules
  └─┬ jam
    └─┬ node_modules
      └── requirejs

NPM v3

.
└─┬ node_modules
  ├── jam
  └── requirejs

As such, fs.readFile('../node_modules/require/require.js', cb) should be replaced with the require syntax: require('require/require.js'), which requires the correct node module from wherever they are stored.

jpstevens commented 8 years ago

bump