MDC101材料设计教程在npm安装时抛出错误



当我运行npm install时,我得到了很多错误(我使用的是mac-Catalina(。

starter npm install
> fsevents@1.2.7 install /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents
> node install
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-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.7 and node@14.15.3 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2722:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in
'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
assert(persistent().IsNearDeath());
~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: 
expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2722:
../../nan/nan_object_wrap.h:127:26: error: no member named 'IsNearDeath' in
'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
assert(wrap->handle_.IsNearDeath());
~~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: 
expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2818:
../../nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use
GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:5272:3: note: 
'GetContents' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8config.h:402:39: note: 
expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
^
../fsevents.cc:43:32: error: no template named 'Handle' in namespace 'v8'
static void Initialize(v8::Handle<v8::Object> exports);
~~~~^
In file included from ../fsevents.cc:73:
../src/constants.cc:89:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagNone").ToLocalChecked()...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:90:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagMustScanSubDirs").ToLoc...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:91:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagUserDropped").ToLocalCh...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:92:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagKernelDropped").ToLocal...
~~~~~~~~^~~

^
In file included from ../fsevents.cc:73:
../src/constants.cc:93:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagEventIdsWrapped").ToLoc...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:94:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagHistoryDone").ToLocalCh...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:95:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagRootChanged").ToLocalCh...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:96:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagMount").ToLocalChecked(...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:97:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagUnmount").ToLocalChecke...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:98:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagItemCreated").ToLocalCh...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:99:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagItemRemoved").ToLocalCh...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:100:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagItemInodeMetaMod").ToLo...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:101:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagItemRenamed").ToLocalCh...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:102:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagItemModified").ToLocalC...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:103:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagItemFinderInfoMod").ToL...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../fsevents.cc:73:
../src/constants.cc:104:11: error: no matching member function for call to 'Set'
object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagItemChangeOwner").ToLoc...
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64" "--napi_version=7" "--node_abi_napi=napi"
gyp ERR! cwd /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents
gyp ERR! node -v v14.15.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node --module_name=fse --module_path=/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64 --napi_version=7 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Darwin 20.2.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents
node-pre-gyp ERR! node -v v14.15.3
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node --module_name=fse --module_path=/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64 --napi_version=7 --node_abi_napi=napi' (1)
> fibers@4.0.1 install /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fibers
> node build.js || nodejs build.js
CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc:899:12: error: no matching member function for call to 'Set'
target->Set(sym_yield, yield);
~~~~~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3673:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
../src/fibers.cc:903:8: error: no matching member function for call to 'Set'
fn->Set(sym_yield, yield);
~~~~^~~
/Users/gayan/Library/Caches/node-gyp/14.15.3/include/node/v8.h:3670:37: note: candidate
function not viable: requires 3 arguments, but 2 were provided
^
../src/fibers.cc:206:25: error: no matching member function for call to 'Set'
info.GetReturnValue().Set(handle);
~~~~~~~~~~~~~~~~~~~~~~^~~
../src/fibers.cc:838:17: note: in instantiation of function template specialization
'uni::Return<v8::Object>' requested here
return uni::Return(current->handle, info);
^
5 errors generated.
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd material-components-web-codelabs-master/mdc-101/starter/node_modules/fibers
gyp ERR! node -v v14.15.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'` 
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fibers@4.0.1 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the fibers@4.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!    
➜  starter 

然后我尝试了以下代码

npm i fsevents@latest -f --save-optional

并尝试使用npm start启动服务器

然后我遇到了以下错误

➜  starter npm start
> mdc-101-web@0.0.0 start /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter
> webpack-dev-server --progress
## There is an issue with `node-fibers` ##
`/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fibers/bin/darwin-x64-83/fibers.node` is missing.
Try running this to fix the issue: /usr/local/bin/node /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fibers/build
Error: Cannot find module '/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fibers/bin/darwin-x64-83/fibers'
Require stack:
- /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fibers/fibers.js
- /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/webpack.config.js
- /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/webpack/bin/convert-argv.js
- /Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/webpack-dev-server/bin/webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fibers/fibers.js:14:39)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fibers/fibers.js:23
throw new Error('Missing binary. See message above.');
^
Error: Missing binary. See message above.
at Object.<anonymous> (/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/node_modules/fibers/fibers.js:23:9)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at getStyleUse (/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/webpack.config.js:16:16)
at Object.<anonymous> (/Users/gayan/Desktop/Web Development/material-components-web-codelabs-master/mdc-101/starter/webpack.config.js:32:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mdc-101-web@0.0.0 start: `webpack-dev-server --progress`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mdc-101-web@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gayan/.npm/_logs/2020-12-19T14_20_40_046Z-debug.log

然后我尝试了以下

npm uninstall fibers
npm install fibers
npm install

之后,我的服务器成功启动

然而,我不明白为什么会出现这个错误。

有人能帮助我为什么下面链接中的教程不起作用,以及为什么这些错误会发生吗

提前谢谢。

https://codelabs.developers.google.com/codelabs/mdc-101-web#1

我也遇到了同样的问题-package-lock.json中的包版本与我的设置不匹配(节点版本等(,所以在删除package-lack.json后,安装顺利,没有任何错误,应用程序也开始运行,没有任何错误。

节点光纤的首页自述中有一条关于这一点的注释。nodejs v16.x或更高版本将不支持光纤
https://github.com/laverdet/node-fibers/issues/451
https://github.com/laverdet/node-fibers

我也遇到过类似的问题,但我的错误是

npm ERR! code 127
npm ERR! path /Users/chad/code/material-components-web-codelabs/mdc-101/starter/node_modules/fibers
npm ERR! command failed
npm ERR! command sh -c node build.js || nodejs build.js
npm ERR! CXX(target) Release/obj.target/fibers/src/fibers.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.5.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/usr/local/opt/python@3.9/bin/python3.9"
...
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../src/fibers.cc:899:12: error: no matching member function for call to 'Set'
npm ERR!                         target->Set(sym_yield, yield);
npm ERR!                         ~~~~~~~~^~~

我尝试了上面提到的原始海报,但仍然有问题。事实证明,节点上不支持光纤>=16.0.0如他们的自述中所述https://github.com/laverdet/node-fibers

更新【2021年4月13日】——光纤与nodejs v16.0.0或更高版本不兼容。不幸的是,v8提交dacc2fee0f是一个突破性的更改,解决方法也很简单。

我最终使用nvm将节点版本设置为14。重新开始安装后,我仍然需要重新安装光纤:

git clone https://github.com/material-components/material-components-web-codelabs
cd material-components-web-codelabs/mdc-101/starter
npm uninstall fibers
npm install fibers
npm install
npm start

然后webpack服务器终于启动了。

相关内容

最新更新