uetchy / create-create-app

⚡️ Create your own `create-something` app.
MIT License
96 stars 24 forks source link

Fails on Windows when Yarn is not installed #18

Closed MurakamiShinyu closed 4 years ago

MurakamiShinyu commented 4 years ago

Testing on Windows, without Yarn installed,

C:\Users\Shinyu>npm create create-app testapp
? description description
? author name MurakamiShinyu
? author email murakami@vivliostyle.org
? template default
? license AGPL-3.0

Creating a new package in C:\Users\Shinyu\create-testapp.

Installing dependencies.
npm ERR! code ENOLOCAL
npm ERR! Could not install from "" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Shinyu\AppData\Roaming\npm-cache\_logs\2020-08-10T04_11_07_268Z-debug.log
installDeps failed: 1

I found that this problem happens when the npm install command is called with a --prefix option,

https://github.com/uetchy/create-create-app/blob/09dbe7fd17aa4ef8e672aec9a5c4463d429446ea/src/index.ts#L108-L109

and npm has the following bug:

Also in Stackoverflow: NPM prefix flag does not work as expected on windows