当我尝试构建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但是没有摆脱错误......
答案 0 :(得分:3)
确保先运行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
我自己遇到了同样的问题......
祝你好运, 罗布。答案 1 :(得分:0)
如果你想自定义包,请在zepto root directoy中打开'make'文件并找到第42行。然后你会看到:
modules = (env['MODULES'] || 'zepto event ajax form ie touch').split(' ')
保存后,修改以空格分割的包。运行
npm run-script dist
在之前的版本中,您必须安装了所有依赖的软件包。