打字稿lint-fix命令在检查打字稿棉布问题后不起作用吗?需要知道解决方法或修复程序
当我通过运行npm运行lint
检查打字条代码中的Linting问题时,它会发出伸缩问题,但是当我尝试使用npm运行lint修复问题时,给出一个错误,说明:
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] lint:fix: `sudo npm run lint --fix`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] lint:fix script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
包装中使用的脚本。JSON是:
"scripts": {
"lint": "./node_modules/tslint/bin/tslint -c tslint.json -p tsconfig.json --exclude 'node_modules/**/*.{j,t}s'",
"lint:fix": "sudo npm run lint --fix",
}
When I check for issues with linting in typescript code by running npm run lint
it gives out the linting issues but when I try fixing the issues using npm run lint:fix
, it gives out an error stating:
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] lint:fix: `sudo npm run lint --fix`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] lint:fix script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
scripts used in the package.json are :
"scripts": {
"lint": "./node_modules/tslint/bin/tslint -c tslint.json -p tsconfig.json --exclude 'node_modules/**/*.{j,t}s'",
"lint:fix": "sudo npm run lint --fix",
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论