简体   繁体   中英

cannot find module breeze with browserify

I am attempting to load breeze using browserify. I used npm to install the breeze-client library. If I run browserify without including breeze everything runs fine, but when I include breeze I get the following error:

Error: Cannot find module 'breeze' from 'C:\...\node_modules\breeze-client'

I've tried doing the require every way I can think of

require("breeze-client");
require("breeze-client/breeze.debug");
require("breeze-client/breeze.debug.js");
require("../node_modules/breeze-client");
// etc...

Only thing I can think of now is that there is an issue with the module that's causing a problem with browserify.

Does anyone know of a change that can be made to the module to get this to work or is there some setting in browserify that I need to use?

Complete error message when trying to run browserify directly on the breeze module:

C:\...>browserify "node_modules/breeze-client" -o "scripts/dist/breeze.js"

Error: Cannot find module 'breeze' from 'C:\...\node_modules\breeze-client'
    at C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:46:17
    at process (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:173:43)
    at ondir (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:188:17)
    at load (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:69:43)
    at onex (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:92:31)
    at C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:95:15)

need to make sure all references to require("breeze") were updated to require("breeze-client") inside the breeze.debug.js file as well as any adapters you might include from the build/adapters directory.

There is a pull-request in to fix this so hopefully it won't be a problem in future versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM