使用npm在本地安装nodejs包的构建方法
rodacom.buildout.npm的Python项目详细描述
使用npm在本地安装nodejs包的zc.buildout方法。
此配方将在本地节点模块目录中安装所需的软件包,并创建指向二进制文件的链接 在buildoutbin目录中。
选项
packages: | required, a list of package names to install (can specify a version with the syntax name@version). |
---|---|
node_path: | absolute path to the node executable, by default the bin/node in buildout directory. |
npm_path: | absolute path to the npm executable, by default the bin/npm in buildout directory. |
strip_extension: | |
set to ‘true’ to strip the .js extension sometimes present on binaries (default is ‘false’). |
示例
使用本地编译的nodejs:
[nodejs] recipe = zc.recipe.cmmi url = http://nodejs.org/dist/v0.10.21/node-v0.10.21.tar.gz bin_node = ${buildout:parts-directory}/nodejs/bin/node bin_npm = ${buildout:parts-directory}/nodejs/bin/npm [coffee] recipe = rodacom.buildout.npm node_path = ${nodejs:bin_node} npm_path = ${nodejs:bin_npm} packages = coffee-script@1.6.3
已知错误
- 卸载时不会删除在“bin”目录中生成的链接。