Skip to content

ReferenceError: root is not defined with --use-yarn option #14

Closed
@QmarkC

Description

@QmarkC

Running npx create-codeceptjs with the --use-yarn option fails with a reference error for root due to a scope issue.

Thrown in the install function on line 201 but root defined out of scope in the createCodecept function on line 101.

Creating CodeceptJS project in /Users/username/code/demo/codeceptjs

Powered by Playwright engine
package.json found, adding codeceptjs dependencies & scripts into it
Installing packages:  codeceptjs@3, @codeceptjs/ui, @codeceptjs/examples, @codeceptjs/configure, playwright@1
(node:71957) UnhandledPromiseRejectionWarning: ReferenceError: root is not defined
    at /Users/username/.npm/_npx/71957/lib/node_modules/create-codeceptjs/index.js:201:19
    at new Promise (<anonymous>)
    at install (/Users/username/.npm/_npx/71957/lib/node_modules/create-codeceptjs/index.js:184:12)
    at createCodecept (/Users/username/.npm/_npx/71957/lib/node_modules/create-codeceptjs/index.js:159:9)
    at Object.<anonymous> (/Users/username/.npm/_npx/71957/lib/node_modules/create-codeceptjs/index.js:86:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:71957) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:71957) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions