Error log:
exec "/home/latte-with-ice/.nvm/versions/node/v16.17.0/bin/node" "/home/latte-with-ice/.nvm/versions/node/v16.17.0/bin/yarn" "$@"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Unexpected string
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1055:15)
at Module._compile (node:internal/modules/cjs/loader:1090:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
Error Cause.
There are two types of yarn installed by system apt install yarn and npm install yarn
Solution:
- Uninstall system yarn first: sudo apt-get remove yarn && sudo apt-get
- [can not do] uninstall yarn from node: npm uninstall -g yarn
- Reinstall yarn: npm install -g yarn
- Re-execute the program and it will work again
Read More:
- Node.js Error: Error: Cannot find module ‘express‘ [How to Solve]
- [Solved] Node.js v17 npm run dev Error: opensslErrorStack
- [Solved] React Startup Error at the First time :SyntaxError: Unexpected token
- [Solved] Webpack compile error: SyntaxError: Unexpected token =
- [Solved] Uncaught SyntaxError: Unexpected token ‘<‘
- js: SyntaxError: Cannot use import statement outside a module
- How to Solve JS error: Unexpected end of JSON input,Unexpected token u in JSON at position 0
- [Solved] SyntaxError: E:\IdeaProject\src\main.js: Identifier ‘ElementPlus‘ has already been declared
- [Solved] JS Error: Uncaught SyntaxError: Illegal return statement
- [Solved] ajax Error: Uncaught SyntaxError: Unexpected end of JSON input
- [Solved] NPM node ERROR in main..js from Terser ChildProcessWorker.initialize Excaption
- Node.js Error: Cannot find module express [How to Solve]
- JS to determine whether the string contains a character
- error in ./node_modules/@lit/reactive-element/decorators/state.jsModule parse failed: Unexpected
- Vue Import three.JS error: Unexpected token [How to Solve]
- [Solved] Node.js: Error: connect ECONNREFUSED ::1:3306
- JS to find the last character of the string and remove it
- [Solved] node.js Upload Files Error: Multipart: boundary not found multer
- Error in created hook: “SyntaxError: Unexpected token u in JSON at position 0
- [Solved] Error in created hook: “SyntaxError: Unexpected token o in JSON at position 1“