4

当我尝试构建 zepto 时,出现以下错误:

MODULES="zepto event polyfill detect fx fx_methods ajax form selector touch gesture" ./make dist
Error: Cannot find module 'shelljs/make'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/kevin/etcgit/zepto/make:4:3)
    at Object.<anonymous> (/Users/kevin/etcgit/zepto/make:153:4)
    at Module._compile (module.js:449:26)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:124:25)
    at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:166:29)
    at fs.stat.notSources.(anonymous function) (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:141:18)
    at fs.readFile (fs.js:176:14)
    at Object.oncomplete (fs.js:297:15)

不知道发生了什么......我确实安装了shell js,但没有摆脱错误......

4

2 回答 2

4

确保你先跑npm install。所以...

cd src/js/libs/zepto
npm install
MODULES="zepto event polyfill detect fx fx_methods ajax form selector touch gesture" ./make dist

来自https://github.com/madrobby/zepto#building

我自己也遇到了同样的问题...

祝你好运,罗伯。

于 2013-04-12T14:38:17.043 回答
0

如果你想自定义包,请打开zepto根目录中的'make'文件,找到第42行。然后你会看到:

modules = (env['MODULES'] || 'zepto event ajax form ie touch').split(' ')

修改用空格分割的包,保存后。跑过

npm run-script dist

以前,你必须安装所有依赖的包。

于 2013-12-30T02:17:28.663 回答