【发布时间】:2016-04-22 15:03:55
【问题描述】:
我有 私有 npm 模块 - @organisation/module。我的模块包含四个文件 - “something.cmd”、“something”、“something.exe”、“index.js”。
index.js:
import path from 'path';
import {exec} from 'child_process';
module.exports = (cb)=>exec(path.join(__dirname, 'something'), cb);
我的同事安装了这个模块(他使用 OS X),但失败并出现错误 /Users/coworker/dev/.../something Permission denied。我们通过将.../something 权限更改为700 来在本地修复它,但我们需要自动执行此操作。
我们的一些服务器运行 Windows,因此我们无法在 npm script 中运行 chmod Unix 命令。
还有哪些其他选择?
【问题讨论】:
标签: node.js cross-platform node-modules npm-install