So this is my first time using yarn for applications and I'm having this issue:
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/user/.config/yarn/global/node_modules/@poppinss/utils/build/src/Helpers/index.js:56:31)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
error Command failed.
Exit code: 1
Command: /home/user/.yarn/bin/create-adonis-ts-app
Arguments: cnc
Directory: /home/user
Output:
This is the second step of the installation and I'm just running this command: yarn create adonis-ts-app cnc
This first part of the installation looks fine but here it is:
yarn create v1.22.18
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- create-adonis-ts-app
/home/user/.config/yarn/global/node_modules/@poppinss/utils/build/src/Helpers/string.js:241
return `${values[0]}${options?.pairSeparator || ' and '}${values[1]}`;
I'm also new to TS so I don't really know how to handle this errors. Thanks!
(I'm running PopOS)
The command should install the packages and help me with the files but the installation failed in the second step.
CodePudding user response:
I had this error a while ago when I upgraded to NodeJS v16.14.0.
Going back to v16.13.2 fixed it for me.
It seems to be a bug in NodeJS.
CodePudding user response:
it's just a syntax error. Please review your code once.