Razzle: Create-razzle-app fails to install dependencies

Created on 3 Sep 2018  路  7Comments  路  Source: jaredpalmer/razzle

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?

Most helpful comment

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

All 7 comments

same here my OS is Linux elementary 0.4.1 Loki

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

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.

https://github.com/jaredpalmer/razzle/blob/666fe9d5cbdc6b7e6bf5410f6534f109ac7f13a8/packages/create-razzle-app/lib/utils/get-install-cmd.js#L13

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.

Getting the same error node v 8.3.0

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 馃帀

@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 [email protected]: 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

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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

corydeppen picture corydeppen  路  3Comments

JacopKane picture JacopKane  路  3Comments

sebmor picture sebmor  路  4Comments

jcblw picture jcblw  路  4Comments

alexjoyner picture alexjoyner  路  3Comments