所以我运行命令 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/