Taro: 编译的时候不成功报错,不知道为什么要下载这个文件

Created on 7 Nov 2018  ·  3Comments  ·  Source: NervJS/taro

在终端输入npm run dev:h5的时候编译,就会报错

gyp ERR! configure error
gyp ERR! stack Error: 404 response downloading https://r.cnpmjs.org/node/v11.0.0/node-v11.0.0-headers.tar.gz
gyp ERR! stack at Request. (/Users/aiewing/Desktop/Taro/myApp/node_modules/node-gyp/lib/install.js:214:14)
gyp ERR! stack at Request.emit (events.js:187:15)
gyp ERR! stack at Request.onRequestResponse (/Users/aiewing/Desktop/Taro/myApp/node_modules/request/request.js:1066:10)
gyp ERR! stack at ClientRequest.emit (events.js:182:13)
gyp ERR! stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:562:21)
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:449:20)
gyp ERR! stack at TLSSocket.emit (events.js:182:13)
gyp ERR! stack at addChunk (_stream_readable.js:283:12)
gyp ERR! stack at readableAddChunk (_stream_readable.js:264:11)
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/usr/local/bin/node" "/Users/aiewing/Desktop/Taro/myApp/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/aiewing/Desktop/Taro/myApp/node_modules/node-sass
gyp ERR! node -v v11.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

系统信息

  • 操作系统: [OSX]
  • Taro 版本 [1.0.0]
  • Node.js 版本 [v9.0.0]
  • 报错平台 [h5]
question

Most helpful comment

应该是 node-sass 没装上, 换成淘宝源试下. 项目根目录放个 .npmrc 文件.

# NPM Taobao registry
registry=https://registry.npm.taobao.org

# Taobao node binary mirrors
fse_binary_host_mirror=https://npm.taobao.org/mirrors/fsevents
sass_binary_site=http://cdn.npm.taobao.org/dist/node-sass

All 3 comments

看日志应该是依赖没有装好,可以重新安装试下

应该是 node-sass 没装上, 换成淘宝源试下. 项目根目录放个 .npmrc 文件.

# NPM Taobao registry
registry=https://registry.npm.taobao.org

# Taobao node binary mirrors
fse_binary_host_mirror=https://npm.taobao.org/mirrors/fsevents
sass_binary_site=http://cdn.npm.taobao.org/dist/node-sass

Hello~

您的问题楼上已经有了确切的回答,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

Was this page helpful?
0 / 5 - 0 ratings