ember new --typescript fails to create a new project
Polve opened this issue · comments
I'm new to ember and trying to do my first project using typescript, so I try to create a new project with this command:
ember new testprj --typescript
But the operation fails with this error:
Installing packages... This might take a couple of minutes.
Command failed with exit code 1: npm install --save-dev --loglevel error ember-cli-typescript
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: prova-ts@0.0.0
npm ERR! Found: stylelint@15.4.0
npm ERR! node_modules/stylelint
npm ERR! dev stylelint@"^15.4.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer stylelint@">= 11.x < 15" from stylelint-config-prettier@9.0.5
npm ERR! node_modules/stylelint-config-prettier
npm ERR! dev stylelint-config-prettier@"^9.0.5" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
I also got a lot of this warnings but I don't know if they are relevant or not:
You passed the '--typescript' flag but there is no TypeScript blueprint available. A JavaScript blueprint will be generated instead.
Output from ember version --verbose && npm --version && yarn --version
:
ember-cli: 4.12.0
node: 18.15.0
v8: 10.2.154.26-node.25
uv: 1.44.2
zlib: 1.2.13
brotli: 1.0.9
ares: 1.18.1
modules: 108
nghttp2: 1.51.0
napi: 8
llhttp: 6.0.10
uvwasi: 0.0.15
acorn: 8.8.2
simdutf: 3.1.0
undici: 5.20.0
openssl: 3.0.8+quic
cldr: 42.0
icu: 72.1
tz: 2022g
unicode: 15.0
ngtcp2: 0.8.1
nghttp3: 0.7.0
os: linux x64
9.6.4
1.22.19
#10251 should fix this. We just need a new release I think.
@Polve I just run into the same situation. To unblock you until release is created you could do the following:
- Create the project with Yarn by setting the
--yarn
flag additionally. - Remove
stylelint-config-prettier
frompackage.json
of newly created project. - Delete
yarn.lock
- Remove
--yarn
flag inconfig/ember-cli-update.js
- Run
npx ember-cli-update --reset
Afterwards you will have a project using NPM. Steps 3-5 are only needed if you want to use NPM. If you are fine with Yarn you could ignore them.
Fix has been released as v4.12.1.