-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn's bundled node-gyp broken #346
Comments
You can refer to: https://circleci.com/gh/coralproject/talk/1921 with details of why the build failed. |
To me it failed only because the build was trying to override the included yarn. I don't see any node-gyp error. |
As you can see, several other build because of trying to install yarn via npm: #337 (comment) |
I linked the wrong build logs :( below is the relevant error:
Which was ran with the repo here https://github.com/coralproject/talk/tree/2c98aa20977155d09b08e927c574be1221d2d707 where I had removed my patch from the Dockerfile to make it the following:
|
Node-gyp is not included in node though so you would always need to install it no? |
Previously, using |
It doesn't install with yarn? |
That's correct. With the following Dockerfile: FROM node:7.6
# Add node-gyp for bcrypt build support
# RUN yarn global add node-gyp
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Setup the environment
ENV NODE_ENV production
ENV PATH /usr/src/app/bin:$PATH
ENV TALK_PORT 5000
EXPOSE 5000
# Install app dependencies
COPY package.json yarn.lock /usr/src/app/
# RUN yarn install --production
RUN npm install --production
# Bundle app source
COPY . /usr/src/app
CMD [ "npm", "start" ] I got no errors during install. |
That's weird...I ran the same thing and it worked:
|
Is it possible that node-gyp installs but isn't working? |
This is my issue: When installing via yarn, I need to run:
While with npm I can run:
I don't need to explicitly install |
Notice that in your example, you explicitly ran
As the second step. |
This seems to be similar to your issue: yarnpkg/yarn#1848 |
I can confirm that after running:
Which resulted in the following changes: diff --git a/package.json b/package.json
index 740063dd..eaa15303 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,7 @@
},
"homepage": "https://github.com/coralproject/talk#readme",
"dependencies": {
- "bcrypt": "^0.8.7",
+ "bcrypt": "^1.0.2",
"body-parser": "^1.15.2",
"cli-table": "^0.3.1",
"commander": "^2.9.0",
diff --git a/yarn.lock b/yarn.lock
index 0331202e..f8a49205 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1089,12 +1089,13 @@ bcrypt-pbkdf@^1.0.0:
dependencies:
tweetnacl "^0.14.3"
-bcrypt@^0.8.7:
- version "0.8.7"
- resolved "https://registry.yarnpkg.com/bcrypt/-/bcrypt-0.8.7.tgz#bc3875a9afd0a7b2cd231a6a7f218a5ce156b093"
+bcrypt@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/bcrypt/-/bcrypt-1.0.2.tgz#d05fc5d223173e0e28ec381c0f00cc25ffaf2736"
dependencies:
bindings "1.2.1"
- nan "2.3.5"
+ nan "2.5.0"
+ node-pre-gyp "0.6.32"
big.js@^3.1.3:
version "3.1.3"
@@ -5006,7 +5007,11 @@ [email protected]:
version "0.0.7"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
-[email protected], nan@^2.3.0:
+[email protected]:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.0.tgz#aa8f1e34531d807e9e27755b234b4a6ec0c152a8"
+
+nan@^2.3.0:
version "2.3.5"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.3.5.tgz#822a0dc266290ce4cd3a12282ca3e7e364668a08"
@@ -5111,7 +5116,7 @@ node-libs-browser@^2.0.0:
util "^0.10.3"
vm-browserify "0.0.4"
-node-pre-gyp@^0.6.29:
+[email protected], node-pre-gyp@^0.6.29:
version "0.6.32"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.32.tgz#fc452b376e7319b3d255f5f34853ef6fd8fe1fd5"
dependencies: It was successfully able to build! I'm still hesitant as the fact that the same package.json + yarn.lock file can build the project successfully without explicitly installing a package (node-gyp) yet yarn required some convincing to get it to run. To me it still feels like there is an issue that yarn should sort out upstream to match the ability that node currently has to build these dependancies properly. I'll close this for now, but feel free to ask any questions if anyone wants to explore this topic more. |
I just tried switching to bcrypt to bcryptjs and it worked, there still is the warning about fsevents though. |
It is indeed weird. I isolated the problem This works: FROM node:7.6
RUN npm install [email protected] This doesn't: FROM node:7.6
RUN yarn add [email protected] |
That would be my conclusion as well. The fact that |
So when building a docker image descended from
I'd be curious if @Daniel15 has any ideas since he is a member of All of our builds/containers have been broken for 2 days now. I'd love to see yarn get removed until |
Still having the issue. Currently using @wyattjoh fix. Adding |
This is fixed in the next version of Yarn (currently only available as an RC, but there should be a stable release soon) |
@Daniel15 cool to know it 👍 I will try |
I just wanted to note my experience here. I was using nvm on a debian box and getting what looked like this node-gyp issue. I had to uninstall nvm and use the system node to actually get everything working. But, I did not need to install node-gyp |
The current version of yarn still has a pre-existing issue with the pre-bundled version of node-gyp related to yarnpkg/yarn#2266
A temporary fix relates to adding:
To our Dockerfile.
The text was updated successfully, but these errors were encountered: