为什么npm会给出奇怪的错误?

时间:2019-09-27 00:47:19

标签: npm npm-install

我正在尝试使用npm安装redux,但是在运行命令npm install redux时,出现以下错误:

bash-3.2$ sudo npm install redux                                                                                    

> fsevents@1.1.2 install /Users/prikshetsharma/Downloads/server/node_modules/fsevents                               
> node install                                                                                                      

node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-no\
de-v72-darwin-x64.tar.gz                                                                                            
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.2 and node@12.10.0 (node-v72 ABI) (falling back to \
source compile with node-gyp)                                                                                       
node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.\
1.2-node-v72-darwin-x64.tar.gz                                                                                      
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.2 and node@12.10.0 (node-v72 ABI) (falling back to \
source compile with node-gyp)                                                                                       
  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:                                                                             
In file included from ../../nan/nan.h:192:                                                                          
../../nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object'                              
  return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);                                          
         ~~~  ^                                                                                                     
In file included from ../fsevents.cc:6:                                                                             
In file included from ../../nan/nan.h:192:                                                                          
../../nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object'                              
  return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);                                          
         ~~~  ^                                                                                                     
In file included from ../fsevents.cc:6:                                                                             
In file included from ../../nan/nan.h:197:                                                                          
In file included from ../../nan/nan_converters.h:59:                                                                
../../nan/nan_converters_43_inl.h:22:1: warning: 'ToBoolean' is deprecated: ToBoolean can never throw. Use Local 
      version. [-Wdeprecated-declarations]                                                                          
X(Boolean)                                                                                                          
^                                                                                                                   
../../nan/nan_converters_43_inl.h:18:12: note: expanded from macro 'X'                                              
      val->To ## TYPE(v8::Isolate::GetCurrent()->GetCurrentContext())          \                                    
           ^                                                                                                        
<scratch space>:19:1: note: expanded from here                                                                      
ToBoolean                                                                                                           
^                                                                                                                   
/Users/prikshetsharma/Library/Caches/node-gyp/12.10.0/include/node/v8.h:2536:3: note: 'ToBoolean' has been          
      explicitly marked deprecated hereIn file included from                                                        
../fsevents.cc:6:                                                                                                   
In file included from ../../nan/nan.h:197:                                                                          
In file included from ../../nan/nan_converters.h:59:                                                                
../../nan/nan_converters_43_inl.h:22:1: warning: 'ToBoolean' is deprecated: ToBoolean   V8_DEPRECATED("ToBoolean ca\
n never throw. Use Local version.",can                                                                              
   ^never                                                                                                           
 throw. Use Local                                                                                                   
      version. [-Wdeprecated-declarations]                                                                          
X(Boolean)                                                                                                          
^                                                                                                                   
../../nan/nan_converters_43_inl.h:18/Users/prikshetsharma/Library/Caches/node-gyp/12.10.0/include/node/v8config.h::\
12311:: 29note::  expandednote : fromexpanded  macrofrom  'X'macro                                                  

      'V8_DEPRECATED'                                                                                               
  declarator __attribute__((deprecated(message)))                                                                   
                            ^                                                                                       
      val->To ## TYPE(v8::Isolate::GetCurrent()->GetCurrentContext())          \                                    
           ^                                                                                                        
<scratch space>:19:1: note: expanded from here                                                                      
ToBoolean                                                                                                           
^                                                                                                                   
/Users/prikshetsharma/Library/Caches/node-gyp/12.10.0/include/node/v8.h:2536:3: note: 'ToBoolean' has been          
      explicitly marked deprecated here                                                                             
  V8_DEPRECATED("ToBoolean can never throw. Use Local version.",In file included from                               
  ^                                                                                                                 
../fsevents.cc:6:                                                                                                   
In file included from ../../nan/nan.h:197:                                                                          
In file included from ../../nan/nan_converters.h:59:                                                                
../../nan/nan_converters_43_inl.h:40:1: warning: /Users/prikshetsharma/Library/Caches/node-gyp/12.10.0/include/node\
/v8config.h:'BooleanValue'311 :is29 :deprecated:  noteBooleanValue:  expandedcan  fromnever  macrothrow.            
       Use'V8_DEPRECATED'                                                                                           

      Isolate version. [-Wdeprecated-declarations]                                                                  
  declarator __attribute__((deprecated(message)))                                                                   
                            ^                                                                                       
X(bool, Boolean)                                                                                                    
^                                                                                                                   
../../nan/nan_converters_43_inl.h:37:15: note: expanded from macro 'X'                                              
  return val->NAME ## Value(isolate->GetCurrentContext());                     \                                    
              ^                                                                                                     
<scratch space>:26:1: note: expanded from here                                                                      
BooleanValue                                                                                                        
^                                                                                                                   
/Users/prikshetsharma/Library/Caches/node-gyp/12.10.0/include/node/v8.h:2574:3: note: 'BooleanValue' has been       
      explicitly marked deprecated here                                                                             
  V8_DEPRECATED("BooleanValue can never throw. Use Isolate version.",                                               
  ^                                                                                                                 
/Users/prikshetsharma/Library/Caches/node-gyp/12.10.0/include/node/v8config.hIn file included from :../fsevents.cc3\
11::629:                                                                                                            
: In file included from note../../nan/nan.h: :197expanded:                                                          
 In file included from from../../nan/nan_converters.h: 59macro:                                                     

../../nan/nan_converters_43_inl.h      :'V8_DEPRECATED'40                                                           
:1: warning: 'BooleanValue' is deprecated: BooleanValue can never throw. Use                                        
      Isolate version.   declarator __attribute__((deprecated(message)))[-Wdeprecated-declarations]                 

                            ^                                                                                       
X(bool, Boolean)                                                                                                    
^                                                                                                                   

实际输出实际上要长十倍,但我认为您可以理解。如何解决这个问题?节点版本:12.10.0。 Npm版本:6.11.3。

2 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,此修复程序是可以使用的正确的节点版本。 第一次收到 $('#example1').datetimepicker({format:'D-MMM-YYYY'}); ,然后用gyp ERR! node -v v13.3.0修复 因此,我建议在nvm下使用node并尝试使用较旧的节点版本!

答案 1 :(得分:0)

试试这个应该可以的。

npm install fsevents@1.2.9

我试过这个并使用这个版本 node -v => v12.18.0npm -v => 6.14.9