[英]Error: Cannot find module 'tslint/lib/lint' when trying to extend tslint-microsoft-contrib
This is our environment 这是我们的环境
> \node_modules\.bin\tslint --version
4.0.1
> npm install --save-dev tslint-microsoft-contrib
`-- tslint-microsoft-contrib@2.0.13
This is our tslint.json configuration. 这是我们的tslint.json配置。
{
"extends": [
"./node_modules/tslint-microsoft-contrib/tslint.json"
]
}
This is what happens when we run our local tslint
with that configuration. 当我们使用该配置运行本地
tslint
时会发生这种情况。
> node_modules\.bin\tslint --config .\tslint.json --project .\tsconfig.json
module.js:471
throw err;
^
Error: Cannot find module 'tslint/lib/lint'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\myApp\node_modules\tslint-microsoft-contrib\insecureRandomRule.js:7:12)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
How can we run tslint
on a configuration that extends tslint-microsoft-contrib
? 我们如何在扩展
tslint-microsoft-contrib
的配置上运行tslint
?
You need to downgrade to tslint 3.xx, tslint-microsoft-contrib doesn't yet support tslint 4, PR #314 should fix that, the PR looks done, but the tests require grunt-tslint to be upgraded to support tslint 4 as well. 你需要降级到tslint 3.xx,tslint-microsoft-contrib还不支持tslint 4,PR #314应该修复,PR看起来已经完成,但测试需要升级grunt-tslint以支持tslint 4好。 For the mean time, you can continue to use tslint@3
同时,您可以继续使用tslint @ 3
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.