Skip to content
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

Parcel runs a strange yarn command on startup, also fails on hawk #1923

Closed
tomitrescak opened this issue Aug 23, 2018 · 12 comments
Closed

Parcel runs a strange yarn command on startup, also fails on hawk #1923

tomitrescak opened this issue Aug 23, 2018 · 12 comments

Comments

@tomitrescak
Copy link

🐛 bug report

When I launch parcel it executes a very strange command "yarn add v1.9.4". It also throws error on hawk plugin ... I do not know what it is.

Server running at http://localhost:1234
yarn add v1.9.4
warning package.json: No license field
warning corporator@0.1.0: No license field
[1/4] Resolving packages...
...
warning client > winston > request > node-uuid@1.4.8: Use uuid module instead
warning client > winston > request > aws-sign@0.2.1: Incorrectly published ES6 version into the 0.x branch
warning client > winston > request > hawk > hoek@0.7.6: The major version is no longer supported. Please update to 4.x or newer
warning client > winston > request > hawk > boom > hoek@0.7.6: The major version is no longer supported. Please update to 4.x or newer
warning client > winston > request > hawk > sntp > hoek@0.7.6: The major version is no longer supported. Please update to 4.x or newer
[2/4] Fetching packages...
error hawk@0.10.2: The engine "node" is incompatible with this module. Expected version "0.8.x".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
🚨  /Users/tomi/Github/apps/corporatorts/src/pages/router.tsx:14:28: Failed to install client.
    at PromiseQueue.install [as process] (/Users/tomi/.config/yarn/global/node_modules/parcel-bundler/src/utils/installPackage.js:40:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

🎛 Configuration (.babelrc, package.json, cli command)

I use Typescript

🤔 Expected Behavior

Parcel should start

😯 Current Behavior

Parcel crashes

💁 Possible Solution

🔦 Context

💻 Code Sample

https://github.com/tomitrescak/corporator

🌍 Your Environment

Software Version(s)
Parcel 1.9.7
Node 10.9.0
npm/Yarn 1.9.4
Operating System Mac
@DeMoorJasper
Copy link
Member

Use --no-autoinstall to disable this feature

@tomitrescak
Copy link
Author

Got it. Worked. Weird though where it took that package name from.

@danielo515
Copy link

I am having the exact same problem, but it was not happening before. It only happens on my CI environment, where parcel tries to install stuff it should not try to.
What is the purpose ?

@Hoishin
Copy link

Hoishin commented Oct 8, 2018

The purpose is to install missing requirements automatically so you don't have to manually install them one by one as error happens

@danielo515
Copy link

Hello @Hoishin ,
The thing is that it tries to install stuff that should be already installed because they are part of my actual dependencies and I have executed an npm install before. This only happens on CI environment by the way.

I think that an easy solution for my case would be to specify to use npm instead of yarn. Several of my dependencies are private, and I have npm correctly configured to access them, so using yarn instead is a problem for me.

Regards

@Hoishin
Copy link

Hoishin commented Oct 9, 2018

If you don't need to use yarn and you have yarn.lock file in your project, you can remove yarn.lock to prevent Parcel to use yarn.
https://parceljs.org/hmr.html#automagically-installed-dependencies

It is weird that it tries to install dependencies that is already installed though. Might be worth looking into it and make an issue.

@danielo515
Copy link

danielo515 commented Oct 9, 2018

Hello @Hoishin , thanks to your prompt response.
I was looking to what you linked on the docs, but I was unable to find it.

According to documentation, two weird things are happening on my case

Parcel tries to install this dependency using yarn or npm depending on finding a yarn.lock file or not.

I don't have an yarn.lock file because we do not use yarn at all, so I don't understand why parcel is trying to use yarn. The only thing I see on parcel log is yarn add v1.9.4, I suppose that it means that it executes yarn add at version v1.9.4

This only occurs in development (using serve or watch), however in production (using build) autoinstall is disabled to prevent unwanted side-effects on deployment.

I'm not using serve neither watch, why is it activating the autoinstall ? This are the commands that are being executed:

    "visual-repl-clean": "rimraf src/services/visual-repl/templates/dist",
        "visual-repl-build": "npm run visual-repl-clean && parcel build --public-url ./repl/ -d src/services/visual-repl/templates/dist src/services/visual-repl/src/index.html",

As you can see, the production mode should be activated

@danielo515
Copy link

Something to make my assertions more credible here are the first lines of log

yarn add v1.9.4
info No lockfile found.
[1/4] Resolving packages...

As you can see, no lockfile found so, why is it using yarn ?

@Hoishin
Copy link

Hoishin commented Oct 9, 2018

Do you have package-lock.json? Seems to me that if there is no lock files it falls back to yarn.

@danielo515
Copy link

No, I don't have package-lock either.
I think the default behavior should be to use npm, which is the defacto standard

@Hoishin
Copy link

Hoishin commented Oct 9, 2018

OK, I looked into the logic that determines the package manager to use, and thought it would default to yarn which I think is wrong too.

Would you mind opening issue?

@danielo515
Copy link

Sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants