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

use strict: command not found #11

Closed
DimitarNestorov opened this issue Apr 6, 2019 · 3 comments
Closed

use strict: command not found #11

DimitarNestorov opened this issue Apr 6, 2019 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@DimitarNestorov
Copy link

/Users/dimitarnestorov/.npm/_npx/8804/bin/browserslist-useragent-regexp: line 1: use strict: command not found
/Users/dimitarnestorov/.npm/_npx/8804/bin/browserslist-useragent-regexp: line 3: syntax error near unexpected token `ex'
/Users/dimitarnestorov/.npm/_npx/8804/bin/browserslist-useragent-regexp: line 3: `function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }'

Adding #!/usr/bin/env node to the top of cli.js fixes the issue

@dangreen dangreen self-assigned this Apr 7, 2019
@dangreen dangreen added the bug Something isn't working label Apr 7, 2019
@dangreen dangreen mentioned this issue Apr 7, 2019
@dangreen
Copy link
Member

dangreen commented Apr 7, 2019

Fixed in #12

@dangreen dangreen closed this as completed Apr 7, 2019
@krzysztof-miemiec
Copy link

I've just tried migrating to 1.1.0-beta from 1.0.2-beta and I got an error in cli script:

/Projects/my-project/node_modules/.bin/browserslist-useragent-regexp: line 3: use strict: command not found
/Projects/my-project/node_modules/.bin/browserslist-useragent-regexp: line 5: syntax error near unexpected token `ex'
/Projects/my-project/node_modules/.bin/browserslist-useragent-regexp: line 5: `function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }'
✨

CLI file starts from a newline, which appears to be invalid, since shebang is supposed to be at the very top of file:


#!/usr/bin/env node
'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var argueCli = require('argue-cli');
var chalk = _interopDefault(require('chalk'));
var Table = _interopDefault(require('easy-table'));
var src = require('./');

@dangreen dangreen mentioned this issue May 8, 2019
@dangreen
Copy link
Member

dangreen commented May 8, 2019

@krzysztof-miemiec fixed in #22

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

3 participants