codeceptjs / CodeceptJS

Supercharged End 2 End Testing Framework for NodeJS
http://codecept.io
MIT License
4.11k stars 723 forks source link

Unable to get started - failed on init (3.0.1) #2631

Closed cbruyndoncx closed 3 years ago

cbruyndoncx commented 3 years ago

What are you trying to achieve?

Getting started initializing a tests directory

What do you get instead?

failed, and instructions to init using the same command as failed

Provide console output if related. Use --verbose mode for more details.

cb@LAP-CARINEB:~$ npm run codeceptjs init

> codeceptjs-tests@0.1.0 codeceptjs /home/cb
> codeceptjs run --steps "init"

Error: Can not load config from /home/cb/codecept.conf.js or /home/cb/codecept.json
CodeceptJS is not initialized in this dir. Execute 'codeceptjs init' to start
    at Function.load (/home/cb/node_modules/codeceptjs/lib/config.js:80:11)
    at module.exports.getConfig (/home/cb/node_modules/codeceptjs/lib/command/utils.js:15:33)
    at Command.module.exports (/home/cb/node_modules/codeceptjs/lib/command/run.js:14:16)
    at Command.listener (/home/cb/node_modules/codeceptjs/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:315:20)
    at Command.parseArgs (/home/cb/node_modules/codeceptjs/node_modules/commander/index.js:651:12)
    at Command.parse (/home/cb/node_modules/codeceptjs/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/home/cb/node_modules/codeceptjs/bin/codecept.js:189:9)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! codeceptjs-tests@0.1.0 codeceptjs: `codeceptjs run --steps "init"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the codeceptjs-tests@0.1.0 codeceptjs script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cb/.npm/_logs/2020-10-24T15_15_36_269Z-debug.log

Details

Initial installation with the create-codeceptjs script npm upgrade to get v3.0.1 with the fix

cb@LAP-CARINEB:~$ cat package.json
{
    "name": "codeceptjs-tests",
    "version": "0.1.0",
    "private": true,
    "scripts": {
        "codeceptjs": "codeceptjs run --steps",
        "codeceptjs:headless": "HEADLESS=true codeceptjs run --steps",
        "codeceptjs:ui": "codecept-ui --app",
        "codeceptjs:demo": "codeceptjs run --steps -c node_modules/@codeceptjs/examples",
        "codeceptjs:demo:headless": "HEADLESS=true codeceptjs run --steps -c node_modules/@codeceptjs/examples",
        "codeceptjs:demo:ui": "codecept-ui --app  -c node_modules/@codeceptjs/examples"
    },
    "devDependencies": {
        "@codeceptjs/configure": "^0.6.0",
        "@codeceptjs/examples": "^1.2.1",
        "@codeceptjs/ui": "^0.4.1",
        "codeceptjs": "^3.0.1",
        "playwright": "^1.5.1"
    },
    "dependencies": {}
}

Logfile

cb@LAP-CARINEB:~/.npm/_logs$ cat 2020-10-24T15_15_36_269Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'codeceptjs', 'init' ]
2 info using npm@6.14.8
3 info using node@v14.14.0
4 verbose config Skipping project config: /home/cb/.npmrc. (matches userconfig)
5 verbose run-script [ 'precodeceptjs', 'codeceptjs', 'postcodeceptjs' ]
6 info lifecycle codeceptjs-tests@0.1.0~precodeceptjs: codeceptjs-tests@0.1.0
7 info lifecycle codeceptjs-tests@0.1.0~codeceptjs: codeceptjs-tests@0.1.0
8 verbose lifecycle codeceptjs-tests@0.1.0~codeceptjs: unsafe-perm in lifecycle true
9 verbose lifecycle codeceptjs-tests@0.1.0~codeceptjs: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/cb/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu20.04onWindows_2004.2020.812.0_x64__79rhkp1fndgsc:/mnt/c/Program Files/Common Files/Microsoft Shared/Microsoft Online Services:/mnt/c/Program Files (x86)/Common Files/Microsoft Shared/Microsoft Online Services:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Intel/WiFi/bin/:/mnt/c/Program Files/Common Files/Intel/WirelessCommon/:/mnt/c/Program Files/Microsoft SQL Server/110/Tools/Binn/:/mnt/c/Program Files (x86)/Microsoft SQL Server/150/DTS/Binn/:/mnt/c/Program Files/PuTTY/:/mnt/c/Program Files/Microsoft SQL Server/130/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Users/CarineB/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files (x86)/Spiceworks/Nmap:/snap/bin
10 verbose lifecycle codeceptjs-tests@0.1.0~codeceptjs: CWD: /home/cb
11 silly lifecycle codeceptjs-tests@0.1.0~codeceptjs: Args: [ '-c', 'codeceptjs run --steps "init"' ]
12 silly lifecycle codeceptjs-tests@0.1.0~codeceptjs: Returned: code: 1  signal: null
13 info lifecycle codeceptjs-tests@0.1.0~codeceptjs: Failed to exec codeceptjs script
14 verbose stack Error: codeceptjs-tests@0.1.0 codeceptjs: `codeceptjs run --steps "init"`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
14 verbose stack     at EventEmitter.emit (events.js:315:20)
14 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
14 verbose stack     at ChildProcess.emit (events.js:315:20)
14 verbose stack     at maybeClose (internal/child_process.js:1048:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
15 verbose pkgid codeceptjs-tests@0.1.0
16 verbose cwd /home/cb
17 verbose Linux 4.19.128-microsoft-standard
18 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "codeceptjs" "init"
19 verbose node v14.14.0
20 verbose npm  v6.14.8
21 error code ELIFECYCLE
22 error errno 1
23 error codeceptjs-tests@0.1.0 codeceptjs: `codeceptjs run --steps "init"`
23 error Exit status 1
24 error Failed at the codeceptjs-tests@0.1.0 codeceptjs script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
cbruyndoncx commented 3 years ago

Oops - sorry NPX codeceptjs init