webpack - 无法使用 node 12.0.0-pre 和 npm 6.6.0 OSX 安装 Webpack

标签 webpack node-gyp fsevents

所以我运行命令 npm install -D webpack

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.7/fse-v1.2.7-node-v68-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.7 and node@12.0.0-pre (node-v68 ABI, unknown) (falling back to source compile with node-gyp) 

...

../../nan/nan_implementation_12_inl.h:356:58: error: expected '(' for function-style cast or type construction
  return v8::StringObject::New(value).As<v8::StringObject>();
                                         ~~~~~~~~~~~~~~~~^
../../nan/nan_implementation_12_inl.h:356:60: error: expected expression
  return v8::StringObject::New(value).As<v8::StringObject>();
                                                           ^
../fsevents.cc:43:32: error: no template named 'Handle' in namespace 'v8'
    static void Initialize(v8::Handle<v8::Object> exports);
                           ~~~~^

...

../fsevents.cc:76:16: error: variable has incomplete type 'void'
void FSEvents::Initialize(v8::Handle<v8::Object> exports) {
               ^
../fsevents.cc:76:31: error: no member named 'Handle' in namespace 'v8'
void FSEvents::Initialize(v8::Handle<v8::Object> exports) {
                          ~~~~^
../fsevents.cc:76:48: error: expected '(' for function-style cast or type construction
void FSEvents::Initialize(v8::Handle<v8::Object> exports) {
                                     ~~~~~~~~~~^
../fsevents.cc:76:50: error: use of undeclared identifier 'exports'
void FSEvents::Initialize(v8::Handle<v8::Object> exports) {
                                                 ^
../fsevents.cc:76:58: error: expected ';' after top level declarator
void FSEvents::Initialize(v8::Handle<v8::Object> exports) {
                                                         ^
                                                         ;
22 warnings and 9 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1

前几天没有发生这种情况,所以我不确定是什么原因造成的。我试过 npm cache clean -f等等,但似乎没有任何效果。

最佳答案

今天自己遇到了这个问题,通过删除 package.lock.json 解决了它和 node_modules ,然后运行 ​​npm install再次。

关于webpack - 无法使用 node 12.0.0-pre 和 npm 6.6.0 OSX 安装 Webpack,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54293394/

相关文章:

javascript - Sass 使用 webpack 没有效果

c# - 在 ASP.NET Core 1.1 中使用 Webpack

reactjs - 当我使用 Turbopack 运行 Next.js 13 时,我得到 "TypeError: Class extends value #"但 webpack 没有错误

node.js - 在 OSX 上安装 webpack 和其他包时,node-gyp 重建失败

objective-c - SCEvents 在某些方法中不起作用?

javascript - Electron 无法在 OS X 上构建平台依赖项 fsevents 和/或 sqllite

javascript - 使用 webpack 为浏览器和 Node 构建

node.js - npm package.json 操作系统特定依赖

node.js - 须藤 npm 安装 bignum -g : OSError: [Errno 13] Permission denied

cocoa - 在 XPC 服务中使用 FSEventStream 不起作用