How to install numjs

Viewed 744

I want to npm install numjs but after 6 hours searching for a solution I have the same problem, an error at the step where it needs to install sharp.

I tried to uninstall everything and reinstall but it still don't want to it. I tried a thousand of solutions that I already forgot but I don't success to do it. What can I try next?

The console output :

gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 
1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Franck\AppData\Roaming\nvm\v12.17.0\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Franck\\AppData\\Roaming\\nvm\\v12.17.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Franck\Documents\CRMexperiment\node_modules\sharp
gyp ERR! node -v v12.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN crm@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.20.8 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.20.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Franck\AppData\Roaming\npm-cache\_logs\2020-06-01T13_57_14_910Z-debug.log

The errors in log file:

1066 error errno 1
1067 error sharp@0.20.8 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
1067 error Exit status 1
1068 error Failed at the sharp@0.20.8 install script.
1068 error This is probably not a problem with npm. There is likely additional logging output above.
2 Answers

You need to update sharp to at least 0.22.1 in order for it to work. This has already been updated inside numjs on Apr 30, 2020 -- see this commit but this is not the version available in npm (npm still serves sharp 0.20.3 i.e. Jun 13 2018 version of the package.json, as the CI fails with newer sharp.

Since it's there in the master (main) branch, you can simply pull it from github like:

npm install https://github.com/nicolaspanel/numjs
yarn add https://github.com/nicolaspanel/numjs

The problem is that numjs is currently not supported on nodejs v12+ because of the sharp dependency. You need to switch to node v10.x.x or earlier, which can be done with nvm for example.

Related