【发布时间】:2017-03-02 10:12:14
【问题描述】:
我是 nodejs 新手,在我的项目中运行 npm install 时出现错误。
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "i"
npm ERR! node v7.7.1
npm ERR! npm v4.1.2
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents@1.0.15: 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
npm ERR! Please include the following file with any support request:
npm ERR! C:\projects\rehouse\src\dd_rehouse_renewal_win\npm-debug.log
我不知道这个错误:Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin",
"arch":"any"} (current: {"os":"win32","arch":"x64"})
请帮我解决。
【问题讨论】:
-
好吧,“wanted os darwin (current win32)”对我来说听起来就像 fsevents 是什么,它需要 MacOS 而不是 windows。但我对节点不够熟悉,不知道该怎么做:/
-
可能是版本问题,看这棵树github.com/npm/npm/issues/14042
-
也尝试
npm cache clean,然后再次运行您的命令 -
谢谢大家,在我的
npm-shrinkwrap.json中为 fsevents 添加optional: true,并使用npm i --no-optional运行后,我解决了我的问题
标签: node.js npm npm-install