Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

[email protected] breaks DefinitelyTyped command npm run lint $package #219

Closed
ericyhwang opened this issue Mar 23, 2019 · 1 comment
Closed
Assignees

Comments

@ericyhwang
Copy link

ericyhwang commented Mar 23, 2019

The contribution instructions in DefinitelyTyped say to run npm run lint package-name:

With [email protected], that command runs successfully. With [email protected], it fails with this error message:

$ npm run lint ____

> [email protected] lint .../DefinitelyTyped
> dtslint types "____"

.../DefinitelyTyped/node_modules/.bin/dtslint: line 1: use strict: command not found
.../DefinitelyTyped/node_modules/.bin/dtslint: line 2: syntax error near unexpected token `('
.../DefinitelyTyped/node_modules/.bin/dtslint: line 2: `var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {'
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] lint: `dtslint types "____"`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Looks like it's because the #!/usr/bin/env node got removed, so the output dtslint file is interpreted as a plaintext file and not a Node JS file:
https://github.com/Microsoft/dtslint/pull/218/files#diff-f41e9d04a45c83f3b6f6e630f10117feL1

This could potentially also be fixed in DefinitelyTyped's package.json, by having it invoke the script with node node_modules/.bin/dtslint, though that means hard-coding a path instead of letting npm-run handle the resolution.

@ericyhwang
Copy link
Author

Tagging @sandersn for issue visibility - DefinitelyTyped's npm run lint still errors with [email protected]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants