You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got an error on my Windows 10 computer when I tried to run eslint.
PS C:\path\to\repository> npx eslint-cjs-to-esm "./src/**/*.{js,ts}"
C:\path\to\repository\node_modules\.bin\eslint:2
basedir=$(dirname "$(echo "$0"| sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
Node.js v20.11.0
An error is occurring in the execution of the eslint sh file.
C:\path\to\repository>npx eslint-cjs-to-esm "./src/**/*.{js,ts}"
node:internal/modules/esm/resolve:303
return new ERR_PACKAGE_PATH_NOT_EXPORTED(
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './bin/eslint.js' is not defined by "exports"in C:\path\to\repository\node_modules\eslint\package.json
at exportsNotFound (node:internal/modules/esm/resolve:303:10)
at packageExportsResolve (node:internal/modules/esm/resolve:650:9)
at resolveExports (node:internal/modules/cjs/loader:591:36)
at Module._findPath (node:internal/modules/cjs/loader:668:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Function.resolve (node:internal/modules/helpers:187:19)
at file:///C:/path/to/repository/node_modules/eslint-cjs-to-esm/eslint-cjs-to-esm.js:7:27
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:28:7) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v20.11.0
I got an error on my Windows 10 computer when I tried to run eslint.
An error is occurring in the execution of the eslint sh file.
https://github.com/azu/eslint-cjs-to-esm/blob/main/eslint-cjs-to-esm.js#L6
I am not familiar with how eslint or npm bin works, but it seems that on Windows bat files are used instead of sh files.
Similar Issues:
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
jestjs/jest#4751The text was updated successfully, but these errors were encountered: