The yarn environment is suddenly unavailable

【报错】ERROR: There are no scenarios; must have at least one.

ERROR: There are no scenarios; must have at least one.

 Backtracking problem

The program 'npm' is currently not installed. To run 'npm' please ask your administrator to install the package 'npm'

 【problem causes】

The version of the npm environment is too low and needs to be updated before use

【Solution】

Reinstall yarn after uninstalling

sudo apt remove cmdtest
sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn

Check the yarn version after installation

 Obviously there are still problems, continue to dig

[cli.js error reporting] SyntaxError: Unexpected token {

/usr/share/yarn/lib/cli.js:46288
  let {
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/share/yarn/bin/yarn.js:24:13)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

【reason】

There is a conflict between the yarn version and the npm version

【Solution】

fixed version install nodejs

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
apt-get install -y nodejs

There will be more detailed information here, first try the 10.x version, it can be successful.

Finally, 14.x was used as recommended in the figure below. If 14.x is unsuccessful, other versions can be used 

According to the above method, the problem is solved

Guess you like

Origin blog.csdn.net/bulucc/article/details/127839842