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

Create-razzle-app fails to install dependencies #743

Closed
jorngeorg opened this issue Sep 3, 2018 · 7 comments
Closed

Create-razzle-app fails to install dependencies #743

jorngeorg opened this issue Sep 3, 2018 · 7 comments

Comments

@jorngeorg
Copy link

jorngeorg commented Sep 3, 2018

When doing create-razzle-app appname this happens:

Creating afm-razzle...

> Success! Created files for "appname" razzle app

  Installing npm modules:
    react
    react-dom
    react-router-dom
    razzle
    express

> Error! Failed to install react, react-dom, react-router-dom, razzle, express, try again.
undefined 

Version is 2.4.0 Any ideas?

@v7
Copy link

v7 commented Sep 10, 2018

same here my OS is Linux elementary 0.4.1 Loki

@panbanda
Copy link

panbanda commented Oct 1, 2018

Was having that issue and using Node 10 solved it for me. nvm use v10.11.0

@aaronchenwei
Copy link
Contributor

Had the similar issue on

  • Windows 7 (with its built-in cmd.exe)
  • node v10.11.0
  • yarn 1.10.1

create-razzle-app is installed through yarn global add create-razzle-app

Running create-razzle-app demo gave the same error message.

  Installing npm modules:
    react
    react-dom
    react-router-dom
    razzle
    express

> Error! Failed to install react, react-dom, react-router-dom, razzle, express, try again.
undefined 

When analyzed the issue further, I found that create-razzle-app is calling npm and ignore yarnpkg even through create-razzle-app was installed with yarn.

execa.sync('yarnpkg', '--version');

Found above code throws error as

TypeError: Cannot create property 'windowsVerbatimArguments' on string '--version'
    at parseNonShell (C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\cross-spawn\lib\parse.js:50:49)
    at Function.parse [as _parse] (C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\cross-spawn\lib\parse.js:110:49)
    at handleArgs (C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\execa\index.js:28:23)
    at Function.module.exports.sync (C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\execa\index.js:268:17)
    at getInstallCmd (C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\create-razzle-app\lib\utils\get-install-cmd.js:13:11)
    at install (C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\create-razzle-app\lib\utils\install.js:19:22)
    at installWithMessage (C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\create-razzle-app\lib\index.js:50:12)
    at tryCallOne (C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\promise\lib\core.js:37:12)
    at C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\promise\lib\core.js:123:15
    at flush (C:\Users\???\AppData\Local\Yarn\Data\global\node_modules\asap\raw.js:50:29)

The workaround for my environment is that to change that line of code into

    execa.shellSync('yarnpkg', '--version');

And then create-razzle-app could finish installing dependency.

@Bournegit
Copy link

Getting the same error node v 8.3.0

aaronchenwei added a commit to aaronchenwei/razzle that referenced this issue Dec 20, 2018
@lilairpod
Copy link

lilairpod commented Jan 20, 2019

this error still occurs despite the fix commit from @aaronchenwei

using npx create-razzle-app demo on node v8.6.0

does this bug mean that create-razzle-app is currently unusable for all new users?

UPDATE: updating my version of Node from 8.6.0 to 11.6.0 solved my issue 🎉

@aaronchenwei
Copy link
Contributor

@lilairpod

My commit was related with yarnpkg. Since you are using npx, it is not relevant.

What was your error? I quickly switched to node v8.6.0 and had an error like below.

error mini-css-extract-plugin@0.4.5: The engine "node" is incompatible with this module. Expected version ">= 6.9.0 <7.0.0 || >= 8.9.0". Got "8.6.0"
error Found incompatible module

some plugins requires higher version of node

@nimahkh
Copy link

nimahkh commented Mar 25, 2019

Dear @jorngeorg
solved this problem by npm cache clean command .
as you can see in /packages/create-razzle-app/lib/utils/install.js , razzle will throw exception when something bad happened in installing required packages . most of problems is about network . but sometimes you installed some package in wrong way like express and it is in your cache to , so npm cant install it again , because installation is broken . so , clean your cache and do it again ,

npm cache clean

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

No branches or pull requests

7 participants