website-v2 icon indicating copy to clipboard operation
website-v2 copied to clipboard

installation error

Open yalin28 opened this issue 3 years ago • 7 comments

When I run npm install I get the following error which prevents me from installing the project:

  • screenshot: image

  • text:

ibuding@Yalin-deddziMac nuxtjs.org-main % npm install
npm WARN deprecated @types/[email protected]: This is a stub types definition. anymatch provides its own type definitions, so you do not need this installed.
npm WARN deprecated @types/[email protected]: This is a stub types definition. browserslist provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: security: please use latest version
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: security: please use latest version
npm WARN deprecated [email protected]: security: please use latest version
npm WARN deprecated [email protected]: security: please use latest version
npm WARN deprecated [email protected]: security: please use latest version
npm WARN deprecated [email protected]: security: please use latest version
npm WARN deprecated [email protected]: security: please use latest version
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @nuxt/[email protected]: Using an outdated and unsupported version of Nuxt kit! Please use latest @nuxt/kit-edge or revert this migration.
npm WARN deprecated [email protected]: Please use the @nuxtjs/i18n package going forward
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /Users/ibuding/Desktop/nuxtjs.org-main/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
npm ERR!   TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CXX(target) Release/obj.target/sharp/src/common.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info find Python using Python version 3.8.9 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/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   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/ibuding/Desktop/nuxtjs.org-main/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/ibuding/Library/Caches/node-gyp/16.14.2/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=/Users/ibuding/Library/Caches/node-gyp/16.14.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/ibuding/Library/Caches/node-gyp/16.14.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/ibuding/Desktop/nuxtjs.org-main/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   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
npm ERR! ../src/common.cc:24:10: fatal error: 'vips/vips8' file not found
npm ERR! #include <vips/vips8>
npm ERR!          ^~~~~~~~~~~~
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/sharp/src/common.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/ibuding/Desktop/nuxtjs.org-main/node_modules/sharp
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ibuding/.npm/_logs/2022-04-25T03_54_38_161Z-debug-0.log
  • some environment:

nodejs : v16.14.2 npm : 8.5.0 OS : macOS Big Sur 11.6.4

I don't know why the installation went wrong, I hope you can help me.

yalin28 avatar Apr 25 '22 04:04 yalin28

Hi @yalin28 It seems your node_modules installation fails on sharp. This node module needs to build a binary, and it looks like your setup cannot make it.

  • I would suggest trying with yarn: rm -rf node_modules ; yarn install, see if it changes anything.
  • Since the build is made with Xcode binaries, you may want to check if you have any updates of Xcode through MacOS Software Updates.

smarroufin avatar Apr 25 '22 09:04 smarroufin

Thanks for your reply, without any changes in the environment, according to your suggestion, I tried to install it with yarn and it was successful. The project works perfectly ! ✌️✌️✌️

yalin28 avatar Apr 25 '22 10:04 yalin28

Glad to hear it! If by any chance you find out why npm fails, keep me posted :blush:

smarroufin avatar Apr 25 '22 10:04 smarroufin

There's a bug in npm 8 relating to corrupt lockfiles that results in npm attempting to run node-gyp rebuild when it shouldn't.

Please see https://github.com/npm/cli/issues/2606#issuecomment-924307833 for a possible workaround.

lovell avatar Apr 26 '22 15:04 lovell

I have just encountered this issue as well, even with deleted lockfiles.

Even with lockfiles and using npx fix-has-install-script, I still have the issue.

The only thing the worked was running npm install --save-dev --build-from-source libvips in the affected workspace dir.

metawrap-dev avatar Apr 26 '22 16:04 metawrap-dev

Thank you @lovell for the report! I guess I didn't encounter it since I'm using npm 6 :roll_eyes:

Thanks @metawrap-dev Nice to have a workaround for npm users

smarroufin avatar Apr 27 '22 09:04 smarroufin

The cause of the issue for me was having a : character in the file path. Looks like something deep in the toolchain is not escaping/unescaping properly.

metawrap-dev avatar Apr 27 '22 09:04 metawrap-dev