[英]can't install expo-cli in the new win 10 1903
我安装了 node js 13.2,我什至尝试安装纱线。 在 Visual Studio 安装程序中,我勾选了 C++ 构建工具和节点 js msbuild。 然而,每当我全局安装 expo-cli 时,我都会收到以下错误:
sharp.cc
utilities.cc
win_delay_load_hook.cc
C:\Users\uPanda\AppData\Roaming\npm\node_modules\expo-cli\node_modules\sharp\src\stats.cc(130,1): error C2661: 'v8::Obj
ect::Set': no overloaded function takes 2 arguments [C:\Users\uPanda\AppData\Roaming\npm\node_modules\expo-cli\node_mod
ules\sharp\build\sharp.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\uPanda\AppData\Roaming\npm\node_modules\expo-cli\node_modules\sharp
gyp ERR! node -v v13.2.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
最后是这样的:
> envsub@3.1.0 postinstall C:\Users\uPanda\AppData\Roaming\npm\node_modules\expo-cli\node_modules\envsub
> test -d .git && cp gitHookPrePush.sh .git/hooks/pre-push || true
'test' is not recognized as an internal or external command,
operable program or batch file.
'true' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sharp@0.22.1 (node_modules\expo-cli\node_modules\sharp):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! envsub@3.1.0 postinstall: `test -d .git && cp gitHookPrePush.sh .git/hooks/pre-push || true`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the envsub@3.1.0 postinstall 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! C:\Users\uPanda\AppData\Roaming\npm-cache\_logs\2019-12-01T12_34_33_996Z-debug.log
C:\Windows\system32>expo
internal/modules/cjs/loader.js:957
throw err;
^
我也有同样的问题。 操作系统:Win 10。据我所知,它与 envsub@3.1.0 相关问题已在新版本的 envsub 中解决,但 expo-cli 仍使用 3.1.0
聚苯乙烯
3.5.0作品
npm install -g expo-cli@3.5.0
执行以下操作: expo init
按照提示进行操作。 您可以选择使用 Yarn 或 npm 安装。 这个对我有用。
我解决了这个问题,答案很简单:
永远不要以管理员权限运行
npm
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.