我第一次尝试在 Windows 的 VS 项目中使用 Node。我安装了node.js,以下是信息:
node -v
v8.9.3
npm -v
5.5.1
使用 npm init 在项目中完成设置,看起来工作正常。
npm install lite-server --save-dev 产生以下错误:
$ npm install lite-server --save-dev
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
我不明白这些错误。帮助。谢谢!
最佳答案
错误来自于fsevents@1.1.3
,它是lite-server
的依赖包。
fsevents@1.1.3
仅适用于 macOS。查看其 npm info page .
Native access to OS X FSEvents in Node.js
The FSEvents API in OS X allows applications to register for notifications of changes to a given directory tree. It is a very fast and lightweight alternative to kqueue.
类似的问题也适用于具有此类依赖性的其他 npm 包。
<小时/>我正在使用最新的稳定版本npm@5.6.0
,并尝试在我的 Windows 上安装。该错误结果是一个警告,并让 lite-server
最终安装。无论如何,fsevents
只是一个可选的依赖项。
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\lite-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ lite-server@2.3.0
added 279 packages in 81.466s
关于node.js - npm install lite-server --save-dev 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48102046/