Comments (2)
在按照66节课执行过程中,执行docker-compose build时报错(具体见下),node-sass找不到(https://github.com/sass/node-sass/releases/download/v4.12.0/linux_musl-x64-79_binding.node)
`Building myaccount-service
Step 1/13 : FROM node:alpine as builder
---> f20a6d8b6721
Step 2/13 : WORKDIR '/build'
---> Using cache
---> 3da06437b10c
Step 3/13 : COPY myaccount ./myaccount
---> Using cache
---> 932d02a7a07b
Step 4/13 : COPY resources ./resources
---> Using cache
---> c84b3d9abc28
Step 5/13 : COPY third_party ./third_party
---> Using cache
---> fb73f7209984
Step 6/13 : WORKDIR '/build/myaccount'
---> Using cache
---> 788b3be97d9b
Step 7/13 : RUN npm install
---> Using cache
---> ad730b8837a9
Step 8/13 : RUN npm rebuild node-sass
---> Running in bffb04285b8d[email protected] install /build/myaccount/node_modules/node-sass
node scripts/install.jsDownloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/linux_musl-x64-79_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.12.0/linux_musl-x64-79_binding.node":HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
[email protected] postinstall /build/myaccount/node_modules/node-sass
node scripts/build.jsBuilding: /usr/local/bin/node /build/myaccount/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
...
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall:node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /root/.npm/_logs/2019-11-10T00_15_16_706Z-debug.log
ERROR: Service 'myaccount-service' failed to build: The command '/bin/sh -c npm rebuild node-sass' returned a non-zero code: 1`
接下午的一些尝试:
本地单独执行“npm rebuild node-sass”命令是成功的(发现node-sass的下载链接是:https://github.com/sass/node-sass/releases/download/v4.12.0/darwin-x64-57_binding.node)
而重新执行’docker-compose build‘ 的时候仍然失败(构建时寻找的node-sass的下载链接还是:https://github.com/sass/node-sass/releases/download/v4.12.0/linux_musl-x64-79_binding.node),可能容器里用的是linux内核,但是这个版本的node-sass找不到
PS:
macos 10.14
brew install node@10(brew install node@8也换过,同样本地可以,docker-compose build不行)
from staffjoy.
根据日志,node是13.1版本,package-lock.json里node-sass的版本为4.12,查看官方兼容列表(https://github.com/sass/node-sass/releases),需要升级到4.13。
解决方法:
将 package-lock.json 中的依赖版本,改为 "node-sass": "^4.13.0",重新docker-compose build ,OK!
from staffjoy.
Related Issues (12)
- npm rebuild node-sass 报错 HOT 1
- k8s在部署完成之后,启用switchhosts之后 在命令行运行kubectl get pod -o wide等命令之后报错 HOT 2
- 项目结构是如何自动生成的 HOT 1
- git clone不下来啊 HOT 2
- English Translation HOT 1
- example数据不行啊,目前有两个问题导致项目跑不起来 HOT 2
- account-svc 会报错 HOT 2
- fronted/app 在win系统启动报错 HOT 4
- myaccount容器编译报错 HOT 2
- web app 模块 HelperService buildUrl 方法应该删除 static 标识 HOT 2
- 注册用户时 FeignException: status 404 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from staffjoy.