eslint --init报错?
环境:
- ESLint Version: v6.0.1
- Node Version: v10.16.0
- npm Version: 6.9.0
问题描述:
使用eslint --init,步骤到安装依赖的时候报错,提示找不到package.json。求解决方法
图上使用的eslint是本地开发依赖,全局安装eslint报同样的错误。
日志:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'i',
1 verbose cli '--save-dev',
1 verbose cli 'eslint-plugin-vue@latest',
1 verbose cli 'eslint-config-plugin:vue/essential,standard@latest' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose npm-session 15f24d7e0071831e
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for file:eslint-config-plugin:vue\essential,standard@latest Could not install from "eslint-config-plugin:vue\essential,standard@latest" as it does not contain a package.json file.
8 http fetch GET 304 https://registry.npm.taobao.org/eslint-plugin-vue 354ms (from cache)
9 silly pacote tag manifest for eslint-plugin-vue@latest fetched in 365ms
10 timing stage:rollbackFailedOptional Completed in 0ms
11 timing stage:runTopLevelLifecycles Completed in 2638ms
12 verbose stack Error: ENOENT: no such file or directory, open 'D:\self\webpack\vue-template\eslint-config-plugin:vue\essential,standard@latest\package.json'
13 verbose cwd D:\self\webpack\vue-template
14 verbose Windows_NT 10.0.18362
15 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "--save-dev" "eslint-plugin-vue@latest" "eslint-config-plugin:vue/essential,standard@latest"
16 verbose node v10.16.0
17 verbose npm v6.9.0
18 error code ENOLOCAL
19 error Could not install from "eslint-config-plugin:vue\essential,standard@latest" as it does not contain a package.json file.
20 verbose exit [ 1, true ]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Fix: --init with Vue.js failed (fixes #11970) #11985