'yarn add all, yarn install, npm install; none of these commands are working for me while I'm using Visual Studio Code

I've been trying to execute the commands npm install, yarn install, yarn add all but no command works for me. I know that yarn is installed for me when I execute npm install yarn. Node.js is also installed in the latest version v16.13.2 and latest VS Code v1.63.2 system set up.

Here are the errors that appear :

  • yarn install

    PS C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5> yarn install
    yarn install v1.22.17
    warning ..\..\package.json: No license field
    warning package-lock.json found. Your project contains lock files generated by t
    ools other than Yarn. It is advised not to mix package managers in order to avoi
    d resolution inconsistencies caused by unsynchronized lock files. To clear this
    warning, remove package-lock.json.
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    [3/4] Linking dependencies...
    [4/4] Building fresh packages...
    error C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_modules
    \canvas: Command failed.
    Exit code: 1
    Command: node-pre-gyp install --fallback-to-build
    Arguments:
    Directory: C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_mo
    dules\canvas
    Output:
    node-pre-gyp info it worked if it ends with ok
    node-pre-gyp info using [email protected]
    node-pre-gyp info using [email protected] | win32 | ia32
    node-pre-gyp info check checked for "C:\Users\MidouPC\Downloads\hashlips_art_eng
    ine-1.1.2_patch_v5\node_modules\canvas\build\Release\canvas.node" (not found)
    node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/downloa
    d/v2.8.0/canvas-v2.8.0-node-v93-win32-unknown-ia32.tar.gz
    node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Au
    tomattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v93-win32-unkno
    wn-ia32.tar.gz
    node-pre-gyp WARN Pre-built binaries not installable for [email protected] and node@1
    6.13.2 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
    node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/
    Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v93-win32-unk
    nown-ia32.tar.gz
    gyp info it worked if it ends with ok
    gyp info using [email protected]
    gyp info using [email protected] | win32 | ia32
    gyp info ok
    gyp info it worked if it ends with ok
    gyp info using [email protected]
    gyp info using [email protected] | win32 | ia32
    gyp info find Python using Python version 3.10.2 found at "C:\Python310\python.e
    xe"
    gyp ERR! find VS
    gyp ERR! find VS msvs_version not set from command line or npm config
    gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
    gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, t
    ry re-running with '--loglevel silly' for more details
    gyp ERR! find VS looking for Visual Studio 2015
    gyp ERR! find VS - not found
    gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
    gyp ERR! find VS
    gyp ERR! find VS **************************************************************
    gyp ERR! find VS You need to install the latest version of Visual Studio
    gyp ERR! find VS including the "Desktop development with C++" workload.
    gyp ERR! find VS For more information consult the documentation at:
    gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
    gyp ERR! find VS **************************************************************
    gyp ERR! find VS
    gyp ERR! configure error
    gyp ERR! stack Error: Could not find any Visual Studio installation to use
    gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\MidouPC\AppData\Local\Ya
    rn\Data\global\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\find-visualstudio.js:75:16
    gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\MidouPC\
    AppData\Local\Yarn\Data\global\node_modules\node-gyp\lib\find-visualstudio.js:36
    3:14)
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\find-visualstudio.js:71:14
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\find-visualstudio.js:384:16
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\util.js:54:7
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\util.js:33:16
    gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
    gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
    gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
    gyp ERR! System Windows_NT 6.3.9600
    gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\MidouPC
    \\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp\\bin\\node-gyp.js"
    "configure" "--fallback-to-build" "--module=C:\\Users\\MidouPC\\Downloads\\hashl
    ips_art_engine-1.1.2_patch_v5\\node_modules\\canvas\\build\\Release\\canvas.node
    " "--module_name=canvas" "--module_path=C:\\Users\\MidouPC\\Downloads\\hashlips_
    art_engine-1.1.2_patch_v5\\node_modules\\canvas\\build\\Release" "--napi_version
    =8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
    
    
    
    
    gyp ERR! cwd C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_
    modules\canvas
    gyp ERR! node -v v16.13.2
    gyp ERR! node-gyp -v v8.4.1
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallb
    ack-to-build --module=C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch
    _v5\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_
    path=C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_modules\
    canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=
    0 --node_napi_label=node-v93' (1)
    node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\MidouPC\Downlo
    ads\hashlips_art_engine-1.1.2_patch_v5\node_modules\@mapbox\node-pre-gyp\lib\uti
    l\compile.js:89:23)
    node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
    node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:interna
    l/child_process:301:5)
    node-pre-gyp ERR! System Windows_NT 6.3.9600
    node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users
    \\MidouPC\\Downloads\\hashlips_art_engine-1.1.2_patch_v5\\node_modules\\@mapbox\
    \node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch
    _v5\node_modules\canvas
    node-pre-gyp ERR! node -v v16.13.2
    node-pre-gyp ERR! node-pre-gyp -v v1.0.6
    node-pre-gyp ERR! not ok
    Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\Users\
    MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_modules\canvas\build\R
    elease\canvas.node --module_name=canvas --module_path=C:\Users\MidouPC\Downloads
    \hashlips_art_engine-1.1.2_patch_v5\node_modules\canvas\build\Release --napi_ver
    sion=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (
    1)
    info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this
    command.
    
    PS C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5>
    
  • npm install

    PS C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5> npm install
    
    up to date, audited 66 packages in 2s
    
    6 packages are looking for funding
      run `npm fund` for details
    
    4 vulnerabilities (3 moderate, 1 high)
    
    To address all issues, run:
      npm audit fix
    
    Run `npm audit` for details.
    PS C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5>
    

    It shows like it was successfully executed but when I run node index.js.

  • yarn add all

    yarn add v1.22.17
    warning ..\..\package.json: No license field
    warning package-lock.json found. Your project contains lock files generated by t
    ools other than Yarn. It is advised not to mix package managers in order to avoi
    d resolution inconsistencies caused by unsynchronized lock files. To clear this
    warning, remove package-lock.json.
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    [3/4] Linking dependencies...
    [4/4] Building fresh packages...
    error C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_modules
    \canvas: Command failed.
    Exit code: 1
    Command: node-pre-gyp install --fallback-to-build
    Arguments:
    Directory: C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_mo
    dules\canvas
    Output:
    node-pre-gyp info it worked if it ends with ok
    node-pre-gyp info using [email protected]
    node-pre-gyp info using [email protected] | win32 | ia32
    node-pre-gyp info check checked for "C:\Users\MidouPC\Downloads\hashlips_art_eng
    ine-1.1.2_patch_v5\node_modules\canvas\build\Release\canvas.node" (not found)
    node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/downloa
    d/v2.8.0/canvas-v2.8.0-node-v93-win32-unknown-ia32.tar.gz
    node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Au
    tomattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v93-win32-unkno
    wn-ia32.tar.gz
    node-pre-gyp WARN Pre-built binaries not installable for [email protected] and node@1
    6.13.2 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
    node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/
    Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v93-win32-unk
    nown-ia32.tar.gz
    gyp info it worked if it ends with ok
    gyp info using [email protected]
    gyp info using [email protected] | win32 | ia32
    gyp info ok
    gyp info it worked if it ends with ok
    gyp info using [email protected]
    gyp info using [email protected] | win32 | ia32
    gyp info find Python using Python version 3.10.2 found at "C:\Python310\python.e
    xe"
    gyp ERR! find VS
    gyp ERR! find VS msvs_version not set from command line or npm config
    gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
    gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, t
    ry re-running with '--loglevel silly' for more details
    gyp ERR! find VS looking for Visual Studio 2015
    gyp ERR! find VS - not found
    gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
    gyp ERR! find VS
    gyp ERR! find VS **************************************************************
    gyp ERR! find VS You need to install the latest version of Visual Studio
    gyp ERR! find VS including the "Desktop development with C++" workload.
    gyp ERR! find VS For more information consult the documentation at:
    gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
    gyp ERR! find VS **************************************************************
    gyp ERR! find VS
    gyp ERR! configure error
    gyp ERR! stack Error: Could not find any Visual Studio installation to use
    gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\MidouPC\AppData\Local\Ya
    rn\Data\global\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\find-visualstudio.js:75:16
    gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\MidouPC\
    AppData\Local\Yarn\Data\global\node_modules\node-gyp\lib\find-visualstudio.js:36
    3:14)
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\find-visualstudio.js:71:14
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\find-visualstudio.js:384:16
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\util.js:54:7
    gyp ERR! stack     at C:\Users\MidouPC\AppData\Local\Yarn\Data\global\node_modul
    es\node-gyp\lib\util.js:33:16
    gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
    gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
    gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
    gyp ERR! System Windows_NT 6.3.9600
    gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\MidouPC
    \\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp\\bin\\node-gyp.js"
    "configure" "--fallback-to-build" "--module=C:\\Users\\MidouPC\\Downloads\\hashl
    ips_art_engine-1.1.2_patch_v5\\node_modules\\canvas\\build\\Release\\canvas.node
    " "--module_name=canvas" "--module_path=C:\\Users\\MidouPC\\Downloads\\hashlips_
    art_engine-1.1.2_patch_v5\\node_modules\\canvas\\build\\Release" "--napi_version
    =8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
    
    gyp ERR! cwd C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_
    modules\canvas
    gyp ERR! node -v v16.13.2
    gyp ERR! node-gyp -v v8.4.1
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallb
    ack-to-build --module=C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch
    _v5\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_
    path=C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_modules\
    canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=
    0 --node_napi_label=node-v93' (1)
    node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\MidouPC\Downlo
    ads\hashlips_art_engine-1.1.2_patch_v5\node_modules\@mapbox\node-pre-gyp\lib\uti
    l\compile.js:89:23)
    node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
    node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:interna
    l/child_process:301:5)
    node-pre-gyp ERR! System Windows_NT 6.3.9600
    node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users
    \\MidouPC\\Downloads\\hashlips_art_engine-1.1.2_patch_v5\\node_modules\\@mapbox\
    \node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch
    _v5\node_modules\canvas
    node-pre-gyp ERR! node -v v16.13.2
    node-pre-gyp ERR! node-pre-gyp -v v1.0.6
    node-pre-gyp ERR! not ok
    Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\Users\
    MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5\node_modules\canvas\build\R
    elease\canvas.node --module_name=canvas --module_path=C:\Users\MidouPC\Downloads
    \hashlips_art_engine-1.1.2_patch_v5\node_modules\canvas\build\Release --napi_ver
    sion=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (
    1)
    info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this comm
    and.
    PS C:\Users\MidouPC\Downloads\hashlips_art_engine-1.1.2_patch_v5>
    

    Same results and same errors as yarn install.

I tried to install node-gyp and updated it but still not working and I also granted administrator use to VS Code, cmd doesn't work well and all these results are appearing in powershell.

I'm using an external terminal but when I use the integrated terminal the error stays the same only the message "install new vscode version/ newer" doesn't appear and also I've used Node.js v14 before that but it's totally not working.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source