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
The installation scripts compatible with CI need to be modified for these reasons.
Must indicate ES Modules because it uses top-level await
PS C:path\to\directory> npm i
> directory@1.0.0 prepare
> node .husky/install.js
C:path\to\directory\.husky\install.js:5
const husky = await import('husky')
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:77:18)
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
npm ERR! code 1
npm ERR! path C:\path\to\directory
npm ERR!command failed
npm ERR!command C:\WINDOWS\system32\cmd.exe /d /s /c node .husky/install.js
husky() is not a function, so it must use husky.default()
PS C:path\to\directory> npm i
> directory@1.0.0 prepare
> node .husky/install.mjs
file:///C:/path/to/directory/.husky/install.mjs:6
husky()
^
TypeError: husky is not a function
at file:///C:/path/to/directory/.husky/install.mjs:6:1
Node.js v20.11.0
npm ERR! code 1
npm ERR! path C:path\to\directory
npm ERR!command failed
CI checks should be fixed
According to ci-info, when we use process.env.CI, we should use !!(process.env.CI !== 'false' && process.env.CI).
The installation scripts compatible with CI need to be modified for these reasons.
Must indicate ES Modules because it uses top-level await
husky()
is not a function, so it must usehusky.default()
CI checks should be fixed
According to ci-info, when we use
process.env.CI
, we should use!!(process.env.CI !== 'false' && process.env.CI)
.https://github.com/watson/ci-info/blob/v4.0.0/index.js#L56-L69
The text was updated successfully, but these errors were encountered: