<p>fil ne parvient pas à installer fsevents alors que npm réussit</p>

Créé le 10 juin 2018  ·  43Commentaires  ·  Source: yarnpkg/yarn

*Avant de créer un problème, assurez-vous d'utiliser la dernière version de laine.*

Vous souhaitez demander une fonctionnalité ou signaler un bug ?

Bogue

Quel est le comportement actuel ?

yarn ne parvient pas à installer fsevents (404s), alors que npm réussit

Si le comportement actuel est un bogue, veuillez fournir les étapes à reproduire.

Avec yarn

❯ git clone [email protected]:minusfive/ember-cli-sass-variables-export.git
❯ cd ember-cli-sass-variables-export
❯ yarn
yarn install v1.7.0
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[-------------------------------------------------------------------------------------------------------------------------------------------------------] 0/1048(node:5246) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[4/5] 🔗  Linking dependencies...
warning " > [email protected]" has unmet peer dependency "eslint@>=3.1.0".
[5/5] 📃  Building fresh packages...
[-/3] ⠁ waiting...
[2/3] ⠂ fsevents
warning Error running install script for optional dependency: "/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install
Arguments:
Directory: /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents
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] | darwin | x64
node-pre-gyp info check checked for \"/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node\" (not found)
node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball file
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp http GET https://nodejs.org/download/release/v10.4.0/node-v10.4.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v10.4.0/node-v10.4.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v10.4.0/node-v10.4.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v10.4.0/node-v10.4.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v10.4.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v10.4.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v10.4.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v10.4.0/SHASUMS256.txt
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/.node-gyp/10.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/minusfive/.node-gyp/10.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/minusfive/.node-gyp/10.4.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/minusfive/.node-gyp/10.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/minusfive/.node-gyp/10.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/minusfive/.node-gyp/10.4.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok
gyp info ok
gyp info it worked if it ends with ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  SOLINK_MODULE(target) Release/.node
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
../../nan/nan.h:839:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:854:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:164:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:869:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:839:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:854:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:164:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:869:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1648:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1648:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED(\"Use MakeCallback(..., async_context)\",
^
/Users/minusfive/.node-gyp/10.4.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../fsevents.cc:85:
../src/methods.cc:14:12: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  handler->Call(3, argv);
           ^
../../nan/nan.h:1567:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
In file included from ../fsevents.cc:85:
../src/methods.cc:14:12: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  handler->Call(3, argv);
           ^
../../nan/nan.h:1567:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
5 warnings generated.
5 warnings generated.
  SOLINK_MODULE(target) Release/fse.node
rm: cannot remove './Release/.deps/Release/obj.target/fse/fsevents.o.d.raw': No such file or directory
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.6.0
gyp ERR! command \"/usr/local/Cellar/node/10.4.0/bin/node\" \"/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64\"
gyp ERR! cwd /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents
gyp ERR! node -v v10.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/10.4.0/bin/node /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Darwin 17.6.0
node-pre-gyp ERR! command \"/usr/local/Cellar/node/10.4.0/bin/node\" \"/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents
node-pre-gyp ERR! node -v v10.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/10.4.0/bin/node /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64' (1)
  COPY /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp
✨  Done in 157.31s.

Avec npm

❯ rm -rf node_modules
❯ npm install

> [email protected] install /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents
> node install

[fsevents] Success: "/Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] install /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-sass
> node scripts/install.js

Cached binary found at /Users/minusfive/.npm/node-sass/4.9.0/darwin-x64-64_binding.node

> [email protected] postinstall /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/spawn-sync
> node postinstall


> [email protected] postinstall /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-sass
> node scripts/build.js

Binary found at /Users/minusfive/dev/oss/ember-cli-sass-variables-export/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Testing binary
Binary is fine
added 1317 packages from 645 contributors and audited 40932 packages in 32.386s

Quel est le comportement attendu ?

ça devrait marcher?

Veuillez mentionner votre node.js, le fil et la version du système d'exploitation.

❯ node -v
v10.4.0

❯ npm -v
6.1.0

❯ yarn -v
1.7.0

❯ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.5
BuildVersion:   17F77
triaged

Commentaire le plus utile

Je reçois également ce problème sur Node 10.4.1 .

Mise à jour : il s'avère que la version de Webpack que nous utilisons dépend d'une ancienne version de fsevents qui n'est pas compatible avec Node ^10 .

Essayez d'exécuter yarn upgrade .

Tous les 43 commentaires

Ce n'est pas du fil. C'est AWS qui vous donne un 404 à partir de l'un des scripts d'installation exécutés via fsevents. On dirait qu'il passe par npm car il a été mis en cache. Si vous réessayez avec Yarn, il se peut que le problème persiste s'il s'agissait d'un problème de serveur temporaire.

Sinon, si vous effacez votre cache npm et réessayez, cela échouera également.

J'ai effacé mes caches de fil et de nœud et j'obtiens toujours cette erreur, fil 1.6.0, nœud 10.1.0.

Je reçois également ce problème sur Node 10.4.1 .

Mise à jour : il s'avère que la version de Webpack que nous utilisons dépend d'une ancienne version de fsevents qui n'est pas compatible avec Node ^10 .

Essayez d'exécuter yarn upgrade .

J'ai également ce problème, mais uniquement dans les répertoires que j'ai configurés avec yarn create react-app [dir name] a quelques mois.

Si je crée un nouveau répertoire, c'est-à-dire pour un projet différent, je n'ai aucun problème.

J'utilise node 10.4.1 npm 6.1.0 yarn 1.7.0

J'ai essayé d'exécuter yarn upgrade mais cela déclenche la même erreur avec fsevents.

Quelqu'un a-t-il d'autres idées ?

@sisterjones J'ai le même problème sur mon Mac avec CRA et ça me rend folle (nœud 10.4.1). Cela fonctionne cependant sous Windows, mais j'ai le nœud 9.11.1 sous Windows

Edit : j'ai rétrogradé à Node 9.11.12 et tout fonctionne bien maintenant. Espérons qu'un correctif soit bientôt disponible

Même problème sur MacOS avec le nœud 10.5.0

même problème avec le nœud 10.6.0 (macOs mojave beta 2)

Il suffit de rétrograder le nœud vers LTS 8.11.3 pour fonctionner correctement.

Chaque version de nodejs inférieure à 10 devrait fonctionner.

J'ai rencontré ce problème lors de la mise à niveau de mon projet Ember vers la version 3.2, qui nécessite le nœud 10+. La seule chose qui a aidé était yarn upgrade .

utiliser le nœud 8.11 fixe

La dernière version de Yarn corrige cela. Je n'ai pas eu ce problème depuis la mise à jour et maintenant j'exécute Node 10.x

Je ne peux pas exécuter la mise à niveau de fil car cela dit:

error Fichier de verrouillage obsolète. Veuillez exécuter yarn install et réessayer.

lors de l'exécution de l'installation de fil, il indique :

erreur /Users/username/Programming/github.com/projectname/node_modules/node-zopfli : la commande a échoué.
Code de sortie : 1

Semble comme une mission impossible pour moi

@Macilias, vous pouvez supprimer le fichier de verrouillage et le fil le yarn install

bien que vrai, le fil ne parvient pas à le recréer une fois le fichier supprimé, le projet reste donc dans un état inutilisable ... Nous n'avons pas pu comprendre comment le mettre à jour pour entrer dans un état utilisable.

J'ai vidé le cache et cela fonctionne parfaitement. essayez yarn cache clean

La même chose avec yarn cache clean sur Mojave OS. ??
Sortir:

...
gyp ERR! cwd /Users/username/.../app/node_modules/fsevents
gyp ERR! node -v v10.12.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
...

Essayez d'abord d'exécuter yarn global add node-gyp , puis essayez d'installer fsevents. D'ailleurs. quelle version de fil utilisez-vous ? Dans les versions récentes, cela ne devrait pas être nécessaire.

J'ai le même problème, tout comme @maximelafarie
essayez d'exécuter yarn global add node-gyp ne m'a pas sauvé. @BYK

yarn version :1.2.1
node version :v10.13.0
npm version :6.4.1
macOS version : Mojave

ÉDITER
Pour ceux qui ont le même problème que moi, je dois rétrograder la version du nœud pour éviter de réinstaller fsevents . Je vais donc coller l'environnement final de mon espace de travail

yarn version :1.2.3
node version :8.12.0

Le mien a fonctionné avec ce qui suit -

rm yarn.lock
yarn cache clean
yarn install

Même erreur que @maximelafarie , avec yarn global add un package est livré avec fsevents , mais yarn cache clean réussit.

  • fil 1.12.1
  • nœud 11.0.0
  • macOS 10.14 Mojave

Éditer
Le problème semble être résolu en exécutant yarn global add node-gyp puis yarn global remove node-gyp ... Je ne suis pas sûr de ce qui s'est passé, de toute façon tout fonctionne sans erreur pour moi 😭

Ce problème m'arrive aussi.

fil 1.12.1
nœud 11.0.0
macOS 1.14 Mojave.

Les correctifs ci-dessus n'ont pas fonctionné pour moi.

Pareil pour moi:

  • fil 1.12.3
  • nœud v11.1.0
  • macOs 10.14.1

Les correctifs ci-dessus n'ont pas fonctionné pour moi.

Moi aussi... pourquoi ce sujet est-il clos ?

09:13:23 $ node -v
v11.2.0
09:18:10 $ yarn -v
1.12.3
09:18:12 $ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.6
BuildVersion:   17G65

Dans mon cas, il a été utile de rétrograder python à 2.7 en utilisant pyenv.

node-gyp nécessiterait python 2.7, pas 3.x.

Sur Mac OS X avec les versions :

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.6
BuildVersion:   17G3025
$ node -v
v11.12.0
$ yarn -v
1.15.2

Ce qui suit a aidé (et oui npm a réussi avant):

# xcode was erroring with brew
sudo xcode-select --switch /Applications/Xcode.app
sudo xcodebuild -license accept

# fresh new node modules
rm -rf node_modules

# solution <strong i="9">@shrinathaithal</strong> (these commands alone did not help though)
rm yarn.lock
yarn cache clean
yarn install

J'avais résolu exactement la même erreur, en changeant la version de node de la dernière à lts.

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.4
BuildVersion:   18E227
$ npm -v
6.4.1
$ yarn -v
1.15.2
$ node -v
v12.0.0

$ sudo n lts
$ node -v
v10.15.3

$ create-react-app my-app

J'ai eu un problème similaire avec Node v12.1.0 sur mon Mac à l'instant. Corrigé en utilisant $ yarn upgrade . Je pense que la clé était la mise à jour de fsevents v1.2.8 à v1.2.9.

J'ai eu le même problème que celui-ci en exécutant ce qui suit:

> sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.4
BuildVersion:   18E226
> node -v
v12.1.0

L'exécution de yarn cache clean suivie de l'utilisation de la version LTS de Node.js à v10.15.3 par opposition à la version actuelle l'a corrigé.

Je suis nvm pour jongler avec plusieurs versions de Node.js.

Un autre corrigé ici en rétrogradant le nœud de v12.2.0 à LTS v10.15.3 .

Il y a eu récemment un problème avec fsevents le rendant incompatible avec le nœud 12. Cela a été résolu et publié dans fsevents v1.2.9. Si vous avez des dépendances qui reposent sur fsevents, vous pouvez dire à Yarn d'utiliser la version 1.2.9 pour chacune d'entre elles en utilisant des résolutions :

Ajoutez ceci à votre fichier package.json , puis réexécutez yarn (ou yarn install ):

"resolutions": {
  "fsevents": "1.2.9"
}

la mise à niveau du fil résout mon problème.

Veuillez noter que Yarn va traiter les packages répertoriés dans resolutions (comme suggéré par @coreyward) comme non facultatifs en raison du bogue #6834. En raison du bogue, votre build peut réussir sur macOS mais échouera sur Linux.

J'ai récemment rencontré ce problème et yarn upgrade a résolu le problème. Merci!

@aindong Avez-vous vu le commentaire au-dessus du vôtre ?

Veuillez noter que Yarn va traiter les packages répertoriés dans resolutions (comme suggéré par @coreyward) comme non facultatifs en raison du bogue #6834. En raison du bogue, votre build peut réussir sur macOS mais échouera sur Linux.

Vous pouvez faire yarn upgrade sur votre mac, qui installera fsevents , mais ensuite quand vous allez déployer sur un serveur Linux où fsevents n'est pas disponible (c'est spécifique à macOS) ça va échouer.

Si vous avez toujours un problème avec fsevents vous devrez probablement mettre à jour les packages que vous utilisez. Ils peuvent avoir d'anciennes dépendances qui utilisent finalement une ancienne version de fsevents . Dans mon cas, c'était nodemod -> yarn upgrade nodemon

Comment les trouver :

  1. yarn list
  2. rechercher en arrière toutes les occurrences de fsevents
  3. mettre à jour ces packages (de préférence vers les dernières versions). yarn upgrade <package>
  4. supprimer les node_modules locaux rm -rf node_modules
  5. nettoyer le cache de fil yarn cache clean
  6. réinstaller les packages yarn

@egel C'est exagéré. La plupart des dépendances qui référencent fsevents tant que dépendance vont l'avoir déclaré comme ~> 0.2.7 ou >= 0.2.7 , ce qui vous permet d'installer la version 0.2.9 tout en continuant à vous réunir les exigences. D'où la solution d'utiliser des résolutions, qui permettent d'avoir Yarn _resolve_ une déclaration de dépendance (par exemple fsevents ~> 0.2.7 ou fsevents ) à une version spécifique.

Notez que cela fonctionne très bien pour la plupart des dépendances, mais parce que fsevents est spécifique à la plate-forme et que les versions précédentes de Yarn ne permettaient pas aux résolutions d'être facultatives, lorsque Yarn serait exécuté dans un environnement qui n'utilise pas fsevents (comme Linux), l'installation des dépendances échouerait. Je pense que cela a été corrigé dans la dernière version de Yarn, mais si ce n'est pas une solution de contournement, ajoutez les résolutions, réexécutez yarn install , puis validez _only_ votre fichier yarn.lock et supprimez la résolution déclaration dans votre fichier package.json . Il en résulte que la version correcte de fsevents sera utilisée à l'avenir, mais puisque les résolutions ne sont pas utilisées, le drapeau facultatif n'est pas écrasé.

Dans tous les cas, l'exécution de commandes telles que rm -rf node_modules et yarn cache clean est inefficace lorsque vous n'avez pas de problème avec les packages corrompus. La reconstruction de l'intégralité du cache sur le réseau est également lente, il n'est pas recommandé de le faire inutilement.

J'ai résolu node-pre-gyp ERR! not ok en changeant la version du nœud en 10.2.1, le fil 1.21.1, et maintenant ça marche bien !

Je ne sais pas si quelqu'un a encore ce problème. je l'ai résolu en faisant
yarn install --check-files
j'ai du le faire plusieurs fois

Je l'ai fait sur OSX 10.13 High Sierra

Travaille pour moi:

yarn upgrade
revert changes in package.json (if needed for your situation)
rm -rf node_modules
rm yarn.lock
yarn
commit newly created lock file

Cela a fonctionné pour moi xcode-select --install

Dans mon cas et depuis que j'ai Babel je n'ai pas pu utiliser :

"resolutions": {
  "**/**/fsevents": "^1.2.9"
}

en raison de plusieurs dépendances imbriquées utilisant une version différente de celui-ci.

Mais j'ai réussi en utilisant:

  "resolutions": {
    "**/**/chokidar": "^2.1.8"
  }

En gros, l'équipe Babel souhaite conserver la compatibilité avec Node 6, c'est pourquoi elle utilise toujours l'ancien fsevents , mais elle prévoit de migrer vers Babel v8.

J'espère que ça aide

J'ai résolu ce problème en supprimant package-lock.json et en réexécutant npm install .

Je ne sais pas si quelqu'un a encore ce problème. je l'ai résolu en faisant
yarn install --check-files
j'ai du le faire plusieurs fois

Je l'ai fait sur OSX 10.13 High Sierra

C'est résolu pour moi ! J'ai également dû le lancer plusieurs fois.
Merci

Cette page vous a été utile?
0 / 5 - 0 notes