Comments (13)
So can this be closed now?
from lint-staged.
I checked on
- 3.0.3 - ok
- 3.2.0 - ok
- 3.2.4 - broken
Tomorrow I'm going to check 3.2.5 and will report back :)
from lint-staged.
lint-staged version 3.2.7
windows 8
node.js version 6.9.2
npm version 3.10.9
I am also experiencing similar issues:
> lint-staged
> Running tasks for src/**/*.{js,vue}
√ eslint --fix
× git add
� git add found some errors. Please fix them and try committing again.
git: 'Files\Git\cmd\git.EXE' is not a git command. See 'git --help'.
I am not sure if this is relevant but I am using cmder for running npm commands.
from lint-staged.
This sounds like a duplicate of #21
from lint-staged.
I think using https://www.npmjs.com/package/@protobufjs/path could solve it. Is anyone with Windows mind trying it out and creating a PR?
from lint-staged.
I am going to try but am not very sure how. But here is some more information. I directly modified my node_modules/lint-staged/src/runScript.js
file to log some more information:
return new Promise((resolve, reject) => {
execa(res.bin, res.args, execaOptions)
.then(() => {
resolve(`${ linter } passed!`)
})
.catch((err) => {
console.log(JSON.stringify(res, null, 2)) // Added this line
console.log(err) // Added this line
reject(new Error(`
🚫 ${ linter } found some errors. Please fix them and try committing again.
${ err.stderr }
${ err.stdout }
`))
In console:
# res object
{
"bin": "C:\\Program Files\\Git\\cmd\\git.EXE",
"args": [
"add",
"--",
"E:\\workspace\\odyssey\\build\\webpack.base.conf.js"
]
}
# Error details
{ Error: spawn undefined ENOENT
at notFoundError (E:\workspace\odyssey\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (E:\workspace\odyssey\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (E:\workspace\odyssey\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn undefined',
killed: false,
stdout: '',
I wrote a simple test to see if execa was the problem:
'use strict';
const execa = require('execa');
const res = {
bin: 'C:\\Program Files\\Git\\cmd\\git.EXE',
args: [
'add',
'--',
'E:\\workspace\\odyssey\\build\\webpack.base.conf.js'
]
};
execa(res.bin, res.args, {})
.then(() => {
console.log('worked!');
})
.catch(err => {
console.log(err);
console.log(new Error('failed'));
});
But this executed without any issue. Please guide me a little so that I can help you fix the issue.
from lint-staged.
I'm not sure what's going on but this is looking suspicious:
syscall: 'spawn undefined',
from lint-staged.
I tried this for getting more details on why the ENOENT
but can't discern anything from the output:
Spawn log
spawn called
{ '0': 'C:\\Program Files\\Git\\cmd\\git.EXE',
'1':
[ 'add',
'--',
'E:\\workspace\\odyssey\\build\\webpack.base.conf.js' ],
'2':
{ maxBuffer: 10000000,
stripEof: true,
preferLocal: true,
encoding: 'utf8',
reject: true,
cleanup: true,
cwd: 'E:\\workspace\\odyssey',
windowsVerbatimArguments: true,
env:
{ aliases: 'E:\\Installs\\cmder\\config\\user-aliases.cmd',
ALLUSERSPROFILE: 'C:\\ProgramData',
ANSICON: '168x1000 (168x42)',
ANSICON_DEF: '7',
APPDATA: 'C:\\Users\\myusername\\AppData\\Roaming',
architecture: '64',
CMDER_ROOT: 'E:\\Installs\\cmder',
CMDER_START: 'E:\\workspace',
CommonProgramFiles: 'C:\\Program Files\\Common Files',
'CommonProgramFiles(x86)': 'C:\\Program Files (x86)\\Common Files',
CommonProgramW6432: 'C:\\Program Files\\Common Files',
COMPUTERNAME: 'PSLBLRLA-154-41',
ComSpec: 'C:\\Windows\\system32\\cmd.exe',
ConEmuANSI: 'ON',
ConEmuAnsiLog: '',
ConEmuArgs: '/Icon "E:\\Installs\\cmder\\icons\\cmder.ico" /Title Cmder',
ConEmuArgs2: '',
ConEmuBackHWND: '0x00040414',
ConEmuBaseDir: 'E:\\Installs\\cmder\\vendor\\conemu-maximus5\\ConEmu',
ConEmuBuild: '161206',
ConEmuConfig: '',
ConEmuDir: 'E:\\Installs\\cmder\\vendor\\conemu-maximus5',
ConEmuDrawHWND: '0x00020456',
ConEmuDrive: 'E:',
ConEmuHooks: 'Enabled',
ConEmuHWND: '0x000103A8',
ConEmuPalette: 'Monokai',
ConEmuPID: '7652',
ConEmuServerPID: '4428',
ConEmuTask: '{cmd::Cmder}',
ConEmuWorkDir: 'C:\\Users\\myusername',
ConEmuWorkDrive: 'C:',
DEFLOGDIR: 'C:\\ProgramData\\McAfee\\DesktopProtection',
FORCE_COLOR: 'true',
FP_NO_HOST_CHECK: 'NO',
GIT_INSTALL_ROOT: 'C:\\Program Files\\Git',
HOME: 'C:\\Users\\myusername',
HOMEDRIVE: 'C:',
HOMEPATH: '\\Users\\myusername',
LOCALAPPDATA: 'C:\\Users\\myusername\\AppData\\Local',
LOGONSERVER: '\\\\ADSERVER2',
NODE: 'C:\\Program Files\\nodejs\\node.exe',
NODE_EXE: 'C:\\Program Files\\nodejs\\\\node.exe',
NPM_CLI_JS: 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm_config_access: '',
npm_config_also: '',
npm_config_always_auth: '',
npm_config_argv: '{"remain":[],"cooked":["run","lint-staged"],"original":["run","lint-staged"]}',
npm_config_bin_links: 'true',
npm_config_browser: '',
npm_config_ca: '',
npm_config_cache: 'C:\\Users\\myusername\\AppData\\Roaming\\npm-cache',
npm_config_cache_lock_retries: '10',
npm_config_cache_lock_stale: '60000',
npm_config_cache_lock_wait: '10000',
npm_config_cache_max: 'Infinity',
npm_config_cache_min: '10',
npm_config_cafile: '',
npm_config_cert: '',
npm_config_color: 'true',
npm_config_depth: 'Infinity',
npm_config_description: 'true',
npm_config_dev: '',
npm_config_dry_run: '',
npm_config_editor: 'notepad.exe',
npm_config_engine_strict: '',
npm_config_fetch_retries: '2',
npm_config_fetch_retry_factor: '10',
npm_config_fetch_retry_maxtimeout: '60000',
npm_config_fetch_retry_mintimeout: '10000',
npm_config_force: '',
npm_config_git: 'git',
npm_config_git_tag_version: 'true',
npm_config_global: '',
npm_config_globalconfig: 'C:\\Program Files\\nodejs\\etc\\npmrc',
npm_config_globalignorefile: 'C:\\Program Files\\nodejs\\etc\\npmignore',
npm_config_global_style: '',
npm_config_group: '',
npm_config_heading: 'npm',
npm_config_https_proxy: '',
npm_config_if_present: '',
npm_config_ignore_scripts: '',
npm_config_init_author_email: '',
npm_config_init_author_name: '',
npm_config_init_author_url: '',
npm_config_init_license: 'ISC',
npm_config_init_module: 'C:\\Users\\myusername\\.npm-init.js',
npm_config_init_version: '1.0.0',
npm_config_json: '',
npm_config_key: '',
npm_config_legacy_bundling: '',
npm_config_link: '',
npm_config_local_address: '',
npm_config_loglevel: 'warn',
npm_config_long: '',
npm_config_maxsockets: '50',
npm_config_message: '%s',
npm_config_node_version: '6.9.2',
npm_config_npat: '',
npm_config_onload_script: '',
npm_config_only: '',
npm_config_optional: 'true',
npm_config_parseable: '',
npm_config_prefix: 'C:\\Program Files\\nodejs',
npm_config_production: '',
npm_config_progress: 'true',
npm_config_proprietary_attribs: 'true',
npm_config_proxy: '',
npm_config_rebuild_bundle: 'true',
npm_config_registry: 'https://registry.npmjs.org/',
npm_config_rollback: 'true',
npm_config_save: '',
npm_config_save_bundle: '',
npm_config_save_dev: '',
npm_config_save_exact: '',
npm_config_save_optional: '',
npm_config_save_prefix: '^',
npm_config_scope: '',
npm_config_searchexclude: '',
npm_config_searchopts: '',
npm_config_searchsort: 'name',
npm_config_shell: 'C:\\Windows\\system32\\cmd.exe',
npm_config_shrinkwrap: 'true',
npm_config_sign_git_tag: '',
npm_config_strict_ssl: 'true',
npm_config_tag: 'latest',
npm_config_tag_version_prefix: 'v',
npm_config_tmp: 'C:\\Users\\SUHAS~1.KAR\\AppData\\Local\\Temp',
npm_config_umask: '0000',
npm_config_unicode: '',
npm_config_unsafe_perm: 'true',
npm_config_usage: '',
npm_config_user: '',
npm_config_userconfig: 'C:\\Users\\myusername\\.npmrc',
npm_config_user_agent: 'npm/3.10.9 node/v6.9.2 win32 x64',
npm_config_version: '',
npm_config_versions: '',
npm_config_viewer: 'browser',
npm_execpath: 'C:\\Users\\myusername\\AppData\\Roaming\\nvm\\v6.9.2\\node_modules\\npm\\bin\\npm-cli.js',
npm_lifecycle_event: 'lint-staged',
npm_lifecycle_script: 'lint-staged',
npm_node_execpath: 'C:\\Program Files\\nodejs\\node.exe',
npm_package_author_email: '[email protected]',
npm_package_author_name: 'myusername',
npm_package_betterScripts_build_command: 'node build/build.js',
npm_package_betterScripts_build_env_NODE_ENV: 'production',
npm_package_betterScripts_dev_command: 'node dev-nodemon.js',
npm_package_betterScripts_dev_env_DEBUG: 'odyssey:*,express:application,express:router:route',
npm_package_betterScripts_dev_env_NODE_ENV: 'development',
npm_package_betterScripts_prod_command: 'node src/app.js',
npm_package_betterScripts_prod_env_NODE_ENV: 'production',
npm_package_dependencies_axios: '^0.15.3',
npm_package_dependencies_better_npm_run: '0.0.14',
npm_package_dependencies_body_parser: '^1.16.0',
npm_package_dependencies_bunyan: '^1.8.5',
npm_package_dependencies_co: '^4.6.0',
npm_package_dependencies_debug: '^2.6.0',
npm_package_dependencies_dot: '^1.1.1',
npm_package_dependencies_element_ui: '^1.1.5',
npm_package_dependencies_express: '^4.14.0',
npm_package_dependencies_express_bunyan_logger: '^1.3.1',
npm_package_dependencies_joi: '^10.2.0',
npm_package_dependencies_lodash: '^4.17.4',
npm_package_dependencies_through: '^2.3.8',
npm_package_dependencies_vue: '^2.1.10',
npm_package_dependencies_vuex: '^2.1.1',
npm_package_dependencies_vuex_router_sync: '^4.1.1',
npm_package_dependencies_vue_router: '^2.1.3',
npm_package_dependencies_whatwg_fetch: '^2.0.2',
npm_package_description: 'CMS tool to power pilgrimages and other themed packages',
npm_package_devDependencies_autoprefixer: '^6.4.0',
npm_package_devDependencies_babel_core: '^6.22.1',
npm_package_devDependencies_babel_eslint: '^7.0.0',
npm_package_devDependencies_babel_loader: '^6.0.0',
npm_package_devDependencies_babel_plugin_component: '^0.9.0',
npm_package_devDependencies_babel_plugin_lodash: '^3.2.11',
npm_package_devDependencies_babel_plugin_transform_runtime: '^6.22.0',
npm_package_devDependencies_babel_preset_es2015: '^6.22.0',
npm_package_devDependencies_babel_preset_stage_1: '^6.22.0',
npm_package_devDependencies_babel_register: '^6.22.0',
npm_package_devDependencies_chalk: '^1.1.3',
npm_package_devDependencies_compression_webpack_plugin: '^0.3.2',
npm_package_devDependencies_connect_history_api_fallback: '^1.1.0',
npm_package_devDependencies_css_loader: '^0.26.1',
npm_package_devDependencies_eslint: '^3.7.1',
npm_package_devDependencies_eslint_friendly_formatter: '^2.0.5',
npm_package_devDependencies_eslint_loader: '^1.5.0',
npm_package_devDependencies_eslint_plugin_html: '^1.3.0',
npm_package_devDependencies_eslint_plugin_lodash: '^2.3.2',
npm_package_devDependencies_eslint_plugin_promise: '^3.4.0',
npm_package_devDependencies_eventsource_polyfill: '^0.9.6',
npm_package_devDependencies_extract_text_webpack_plugin: '^2.0.0-beta.5',
npm_package_devDependencies_file_loader: '^0.9.0',
npm_package_devDependencies_friendly_errors_webpack_plugin: '^1.1.2',
npm_package_devDependencies_function_bind: '^1.0.2',
npm_package_devDependencies_html_webpack_plugin: '^2.8.1',
npm_package_devDependencies_http_proxy_middleware: '^0.17.2',
npm_package_devDependencies_json_loader: '^0.5.4',
npm_package_devDependencies_lint_staged: '^3.2.7',
npm_package_devDependencies_lodash_webpack_plugin: '^0.11.0',
npm_package_devDependencies_nodemon: '^1.11.0',
npm_package_devDependencies_opn: '^4.0.2',
npm_package_devDependencies_ora: '^1.0.0',
npm_package_devDependencies_pre_commit: '^1.2.2',
npm_package_devDependencies_pug: '^2.0.0-beta6',
npm_package_devDependencies_semver: '^5.3.0',
npm_package_devDependencies_shelljs: '^0.7.4',
npm_package_devDependencies_url_loader: '^0.5.7',
npm_package_devDependencies_vue_loader: '^10.0.0',
npm_package_devDependencies_vue_style_loader: '^1.0.0',
npm_package_devDependencies_vue_template_compiler: '^2.1.10',
npm_package_devDependencies_webpack: '^2.2.0',
npm_package_devDependencies_webpack_dev_middleware: '^1.8.3',
npm_package_devDependencies_webpack_hot_middleware: '^2.12.2',
npm_package_devDependencies_webpack_merge: '^2.4.0',
npm_package_engines_node: '>= 6.9.2',
npm_package_engines_npm: '>= 3.10.9',
npm_package_gitHead: 'b617ec746853cfaa64d5a6bfb3a065ac2e53b5ec',
npm_package_lint_staged_build___js_0: 'eslint --fix',
npm_package_lint_staged_build___js_1: 'git add',
npm_package_lint_staged_config___js_0: 'eslint --fix',
npm_package_lint_staged_config___js_1: 'git add',
npm_package_lint_staged_src_______js_vue__0: 'eslint --fix',
npm_package_name: 'odyssey',
npm_package_pre_commit: 'lint',
npm_package_private: 'true',
npm_package_readmeFilename: 'README.md',
npm_package_scripts_build: 'better-npm-run build',
npm_package_scripts_dev: 'better-npm-run dev',
npm_package_scripts_lint: 'eslint --ext .js,.vue src build config',
npm_package_scripts_lint_fix: 'npm run lint -- --fix',
npm_package_scripts_lint_staged: 'lint-staged',
npm_package_scripts_prod: 'better-npm-run prod',
npm_package_version: '0.1.0',
NPM_PREFIX_NPM_CLI_JS: 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
NUMBER_OF_PROCESSORS: '4',
NVM_HOME: 'C:\\Users\\myusername\\AppData\\Roaming\\nvm',
NVM_SYMLINK: 'C:\\Program Files\\nodejs',
OPENSSL_CONF: 'C:\\OpenSSL-Win64\\bin\\openssl.cfg',
OS: 'Windows_NT',
Path: 'E:\\workspace\\odyssey\\node_modules\\.bin;E:\\workspace\\node_modules\\.bin;E:\\node_modules\\.bin;C:\\Program Files\\nodejs;C:\\Users\\myusername\\AppData\\Roaming\\nvm\\v6.9.2\\node_modules\\npm\\bin\\node-gyp-bin;E:\\workspace\\odyssey\\node_modules\\.bin;E:\\Installs\\cmder\\bin;E:\\Installs\\cmder\\vendor\\conemu-maximus5\\ConEmu\\Scripts;E:\\Installs\\cmder\\vendor\\conemu-maximus5;E:\\Installs\\cmder\\vendor\\conemu-maximus5\\ConEmu;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\mingw64\\bin;C:\\Program Files\\Git\\usr\\bin;C:\\Users\\myusername\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Program Files\\Sublime Text 3\\;C:\\Program Files\\OpenVPN\\bin;C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.0\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Amazon\\AWSCLI\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\mingw64\\bin;C:\\Program Files\\Git\\usr\\bin;C:\\Users\\myusername\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;;C:\\Program Files (x86)\\Microsoft VS Code\\bin;C:\\Python27\\;C:\\Python27\\Scripts\\;C:\\Program Files\\Git\\usr\\bin;C:\\Program Files\\Git\\usr\\share\\vim\\vim74;E:\\Installs\\cmder\\',
PATHEXT: '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JSE;.WSF;.WSH;.MSC',
PLINK_PROTOCOL: 'ssh',
PROCESSOR_ARCHITECTURE: 'AMD64',
PROCESSOR_IDENTIFIER: 'Intel64 Family 6 Model 61 Stepping 4, GenuineIntel',
PROCESSOR_LEVEL: '6',
PROCESSOR_REVISION: '3d04',
ProgramData: 'C:\\ProgramData',
ProgramFiles: 'C:\\Program Files',
'ProgramFiles(x86)': 'C:\\Program Files (x86)',
ProgramW6432: 'C:\\Program Files',
PROMPT: 'C\bL\bI\bN\bK\b \b$P$G',
PSModulePath: 'C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\',
PUBLIC: 'C:\\Users\\Public',
SESSIONNAME: 'Console',
SUBLIME: 'C:\\Program Files\\Sublime Text 3',
SVN_SSH: 'C:\\\\Program Files\\\\Git\\\\bin\\\\ssh.exe',
SystemDrive: 'C:',
SystemRoot: 'C:\\Windows',
TEMP: 'C:\\Users\\SUHAS~1.KAR\\AppData\\Local\\Temp',
TERM: 'cygwin',
TMP: 'C:\\Users\\SUHAS~1.KAR\\AppData\\Local\\Temp',
TVT: 'C:\\Program Files (x86)\\Lenovo',
'user-aliases': 'E:\\Installs\\cmder\\config\\user-aliases.cmd',
USERDNSDOMAIN: 'mycompany.OFFICE',
USERDOMAIN: 'mycompany',
USERDOMAIN_ROAMINGPROFILE: 'mycompany',
USERNAME: 'myusername',
USERPROFILE: 'C:\\Users\\myusername',
'verbose-output': '0 ',
VS110COMNTOOLS: 'C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\',
VS120COMNTOOLS: 'C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\',
windir: 'C:\\Windows' } } }
from lint-staged.
This is what I've found: sindresorhus/execa#27
from lint-staged.
from lint-staged.
@sudo-suhas what does this mean for this lib? Do I need to change something?
from lint-staged.
Same problem, v3.2.7
from lint-staged.
Hey.. I found the issue and have created a pull request(my first one :)).
Looks like it doesn't have anything to do with the execa bug after all.
from lint-staged.
Related Issues (20)
- Changelog Incorrect : Package Version 13.3.0 drops support for Node.js 14 HOT 1
- .git is symbolic link not support HOT 1
- Typescript tsc command checks the type of all files not only staged HOT 1
- SyntaxError: Unexpected reserved word at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18) HOT 4
- Unable to run `lint-staged` programmatically due to lack of types. HOT 2
- Warning when running ESLint with lint-staged: File ignored by default (for eslint cofniguration file) HOT 1
- Use another exit code for internal error.
- Running lint-stage inexplicably changes code HOT 1
- Unsupported engine warning in node 18.2.0 HOT 1
- exit with exit code 1 without printing anything HOT 4
- How to restore stash files into workspace when lint-staged error HOT 2
- Failed to resolve git repo on mapped network drive HOT 12
- Commits from Github Desktop occur errors HOT 4
- Not all lintstagedrc.json files are found in the rush.js monorepo HOT 4
- Type '(filenames: string[]) => Commands | Promise<Commands>' is not assignable to type 'string' HOT 2
- There is a bug with bracketed folders HOT 5
- Importing a reusable json file to ESM JS config fails HOT 1
- Path for baseConfig HOT 2
- lint-staged is unable to resolve path to module in Monorepo with map imports HOT 9
- Many errors in standard output when using git sparse-checkout HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lint-staged.