Error while installing dependencies in root

Facing an Error while installing dependencies in root.

❯ npm i

> postinstall
> npm run bootstrap --no-ci && npm run build


> bootstrap
> lerna bootstrap --no-ci

lerna notice cli v3.22.1
lerna info versioning independent
lerna info Bootstrapping 15 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 7 in '@joplin/tools'
lerna ERR! npm install stderr:
npm ERR! code 7
npm ERR! path D:\GSOC\joplin\packages\tools\node_modules\sharp
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
npm ERR! info sharp Using cached C:\Users\soodr\AppData\Local\npm-cache\_libvips\libvips-8.9.1-win32-x64.tar.gz
npm ERR! info sharp Creating D:\GSOC\joplin\packages\tools\node_modules\sharp\build\Release
npm ERR! info sharp Copying DLLs from D:\GSOC\joplin\packages\tools\node_modules\sharp\vendor\lib to D:\GSOC\joplin\packages\tools\node_modules\sharp\build\Release
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@15.9.0 | win32 | x64
npm ERR! gyp info spawn C:\Users\soodr\.windows-build-tools\python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'D:\\GSOC\\joplin\\packages\\tools\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-G',
npm ERR! gyp info spawn args   'msvs_version=2015',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\GSOC\\joplin\\packages\\tools\\node_modules\\sharp\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\GSOC\\joplin\\packages\\tools\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\soodr\\.node-gyp\\15.9.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\soodr\\.node-gyp\\15.9.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=D:\\GSOC\\joplin\\packages\\tools\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\Users\\soodr\\.node-gyp\\15.9.0\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=D:\\GSOC\\joplin\\packages\\tools\\node_modules\\sharp',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'D:\\GSOC\\joplin\\packages\\tools\\node_modules\\sharp\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:480:16)
npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:81:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\GSOC\\joplin\\packages\\tools\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\GSOC\joplin\packages\tools\node_modules\sharp
npm ERR! gyp ERR! node -v v15.9.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! This is a bug in `node-gyp`.
npm ERR! gyp ERR! Try to update node-gyp and file an Issue if it does not help:
npm ERR! gyp ERR!     <https://github.com/nodejs/node-gyp/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\soodr\AppData\Local\npm-cache\_logs\2021-03-10T14_31_13_364Z-debug.log

lerna ERR! npm install exited 7 in '@joplin/tools'
lerna WARN complete Waiting for 7 child processes to exit. CTRL-C to exit immediately.
npm ERR! code 7
npm ERR! path D:\GSOC\joplin
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c lerna bootstrap --no-ci

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\soodr\AppData\Local\npm-cache\_logs\2021-03-10T14_31_13_661Z-debug.log
npm ERR! code 7
npm ERR! path D:\GSOC\joplin
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npm run bootstrap --no-ci && npm run build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\soodr\AppData\Local\npm-cache\_logs\2021-03-10T14_31_13_690Z-debug.log

My node version is up to date:

❯ node --version
v15.9.0

And i have all the global dependencies installed:

❯ npm list -g
C:\Users\soodr\AppData\Roaming\npm
+-- firebase-tools@9.3.0
+-- gulp-cli@2.3.0
+-- npm@7.5.4
+-- windows-build-tools@5.2.2
`-- yarn@1.22.10

Can someone please help?

Well it tells you right there:

Updating node-gyp didn't help :frowning: .

 cd "C:\Program Files\nodejs\node_modules\npm"
npm install -g node-gyp@latest

Received the same error, please help:

❯ npm i

> postinstall
> npm run bootstrap --no-ci && npm run build


> bootstrap
> lerna bootstrap --no-ci

lerna notice cli v3.22.1
lerna info versioning independent
lerna info Bootstrapping 15 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 7 in '@joplin/tools'
lerna ERR! npm install stderr:
npm ERR! code 7
npm ERR! path D:\GSOC\joplin\packages\tools\node_modules\sharp
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
npm ERR! info sharp Using cached C:\Users\soodr\AppData\Local\npm-cache\_libvips\libvips-8.9.1-win32-x64.tar.gz
npm ERR! info sharp Creating D:\GSOC\joplin\packages\tools\node_modules\sharp\build\Release
npm ERR! info sharp Copying DLLs from D:\GSOC\joplin\packages\tools\node_modules\sharp\vendor\lib to D:\GSOC\joplin\packages\tools\node_modules\sharp\build\Release
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@15.9.0 | win32 | x64
npm ERR! gyp info spawn C:\Users\soodr\.windows-build-tools\python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'D:\\GSOC\\joplin\\packages\\tools\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-G',
npm ERR! gyp info spawn args   'msvs_version=2015',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\GSOC\\joplin\\packages\\tools\\node_modules\\sharp\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\GSOC\\joplin\\packages\\tools\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\soodr\\.node-gyp\\15.9.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\soodr\\.node-gyp\\15.9.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=D:\\GSOC\\joplin\\packages\\tools\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\Users\\soodr\\.node-gyp\\15.9.0\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=D:\\GSOC\\joplin\\packages\\tools\\node_modules\\sharp',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'D:\\GSOC\\joplin\\packages\\tools\\node_modules\\sharp\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:480:16)
npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:81:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\GSOC\\joplin\\packages\\tools\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\GSOC\joplin\packages\tools\node_modules\sharp
npm ERR! gyp ERR! node -v v15.9.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! This is a bug in `node-gyp`.
npm ERR! gyp ERR! Try to update node-gyp and file an Issue if it does not help:
npm ERR! gyp ERR!     <https://github.com/nodejs/node-gyp/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\soodr\AppData\Local\npm-cache\_logs\2021-03-10T14_49_26_020Z-debug.log

lerna ERR! npm install exited 7 in '@joplin/tools'
npm ERR! code 7
npm ERR! path D:\GSOC\joplin
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c lerna bootstrap --no-ci

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\soodr\AppData\Local\npm-cache\_logs\2021-03-10T14_49_26_124Z-debug.log
npm ERR! code 7
npm ERR! path D:\GSOC\joplin
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npm run bootstrap --no-ci && npm run build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\soodr\AppData\Local\npm-cache\_logs\2021-03-10T14_49_26_147Z-debug.log

You said you've updated it yet your log still shows

npm ERR! gyp ERR! node-gyp -v v3.8.0

Check note-gyp's repo and docs for any similar issues.

Tried alot, not able to setup my development environment :pensive:. It would be great if you could share the steps to setup the development environment here, (I tried using the ones specified here joplin/BUILD.md at dev · laurent22/joplin · GitHub, but failed).

If it's not working under Windows, maybe try under WSL as that might be easier. Also try different Node version, v12 should work for instance.

Have you seen this This is a bug with node-gyp · Issue #2310 · nodejs/node-gyp · GitHub ? Or this Updating npm's bundled node gyp · nodejs/node-gyp Wiki · GitHub ?

Alright, will try!

It suggests a newer version of node-gyp, which even on updating globally or locally isn't helping

should i try setting up my environment on a VM (arch/ubuntu)?

Why not try, instead of asking if you should try? :slight_smile:

1 Like

It's certainly possible to set everything up on Windows, even without WSL - I have been using it until very recently.
I've since deleted my Windows dir so can't confirm the exact version I was using.

Both your logs show the same version 3.8.0 so whatever you did to update didn't seem to work.

I went around a different approach and got my development environment working, thank you so much for your help sir!

You should share what you did to fix it for the next person having the same issue.

1 Like

I only needed the development environment to start working on building a plugin, so I went ahead and installed the Joplin desktop app for windows, activated the development mode and added my plugin to the development plugins text field as specified here: Getting started with plugin development | Joplin

I am using this versions
node -v v14.15.4
node-gyp -v v5.1.0

2 Likes