Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

命令行工具在macOS系统下无法执行 #3

Open
huguangju opened this issue Sep 26, 2019 · 2 comments
Open

命令行工具在macOS系统下无法执行 #3

huguangju opened this issue Sep 26, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@huguangju
Copy link

执行 npx iconfont-init,报错如下:

mini-program-iconfont/node_modules/.bin/iconfont-init: line 1: use strict: command not found
mini-program-iconfont/node_modules/.bin/iconfont-init: line 2: syntax error near unexpected token `exports,'
mini-program-iconfont/node_modules/.bin/iconfont-init: line 2: `Object.defineProperty(exports, "__esModule", { value: true });'

原因: .node_modules/bin/ 下的 node 脚本没有在文件开始写 Shebang 命令行,所以会被误为 shell 脚本执行而导致错误

解决:在文件头加上 #!/usr/bin/env node 即可

@fwh1990
Copy link
Member

fwh1990 commented Sep 26, 2019

之前是统一入口的是有加env,现在分路口,给漏了,抱歉,现在加上去

@fwh1990 fwh1990 added the bug Something isn't working label Sep 26, 2019
@fwh1990
Copy link
Member

fwh1990 commented Sep 26, 2019

发布了新版本 @huguangju

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants