You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to create new Ionic app with @ionic/cli #4434
Description:
Hi.
I've been wanting to create a new ionic app for a while and decided to create a new one since React support came out. I followed the guide from this link: Ionic start
It finalizes with introducing the following steps to run:
npm install -g @ionic/cli cordova-res
ionic start --start-id ID-FOR-CREATION
However running the ionic command (or just writing ionic) fails to run. So essentially the entire ionic cli is not working. I've tested following versions of @ionic/cli: 6.9.0, 6.8.0, 6.7.0 and 6.5.0.
I have noticed weird symbols in the error message, it might have something to do with it?
My current environment:
Windows 10 Pro (en-GB)
Node v14.2.0
NPM 6.14.5
Steps to Reproduce:
npm install -g @ionic/cli cordova-res
ionic start
TypeError: Cannot set property pathExists of # which has only a getter
at Object. (C:\Users\ahb\AppData\Roaming\nvm\v14.2.0\node_modules\�[4m@ionic�[24m\cli\node_modules\�[4m@ionic�[24m\utils-fs\dist\index.js:168:20)
�[90m at Module._compile (internal/modules/cjs/loader.js:1176:30)�[39m
�[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)�[39m
�[90m at Module.load (internal/modules/cjs/loader.js:1040:32)�[39m
�[90m at Function.Module._load (internal/modules/cjs/loader.js:929:14)�[39m
�[90m at Module.require (internal/modules/cjs/loader.js:1080:19)�[39m
�[90m at require (internal/modules/cjs/helpers.js:72:18)�[39m
at Object. (C:\Users\ahb\AppData\Roaming\nvm\v14.2.0\node_modules\�[4m@ionic�[24m\cli\node_modules\�[4m@ionic�[24m\cli-framework\utils\node.js:3:20)
�[90m at Module._compile (internal/modules/cjs/loader.js:1176:30)�[39m
�[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)�[39m
My ionic info:
Unable to run any ionic commands. All of them produce the error above
Reacted by Rico Berger, Roman, Pouya Liaghat mehr, MonoHearted, Jesús Bossa, TobiasBianchiKC, Zeno Trevisan, CasperG, Jonathan Ngbonga, mrgksri and 1 more
Looks like an incompatibility between tslib 1.12.0 and our FS utility library. I've pinned tslib, which should fix the issue for now.
Please update the Ionic CLI to fix the issue:
npm i -g @ionic/cli@6.9.1
Reacted by NguyenTaiAnh
Reacted by MonoHearted, Jesús Bossa, Thisura Dodangoda, Jean Pierre, Murilo Alves, Pouya Liaghat mehr, Otacilio Oliveira (Neto), Jorge Gustavo Hernandez Valladares, Lucas Carnevalli, Josh Thomas and 10 more
If you are still having problems to execute ionic serve or similar commands, do a npm install tslib@1.11.0 that should solve that issue, right after doing @dwieeb solution.
Reacted by Jonathan Perry and Timo Knapp
Reacted by Thiago Marafon, schagani, Yousef Qamaz and Timo Knapp
@dwieeb I discovered this issue because we are encountering the same error in a project that is still using the deprecated Ionic CLI (v5.4.16). You mentioned that the issue appears to be an incompatibility between tslib and @ionic/utils-fs. That would explain why we are also experiencing the problem.
Would it be possible to pin tslib and publish a fix to the @ionic/utils-fs library instead of the downstream packages? That would address the problem for us and probably more broadly.
If you're using an old CLI version, is there a reason you're not using the latest? The Ionic CLI supports all versions of the Ionic Framework and breaking changes are minimal (mostly related to changing the minimum NodeJS version).
In our case, it was a CI pipeline that was using the deprecated version. Since the deprecation happened recently but our builds were unaffected, our devops team considered upgrading to be a low priority. Due to this issue we have now upgraded to 6.9.1 and the issue is resolved for us.
Thank you for clarifying the package dependencies and linking to the associated tslib issues. It seems that this is a much broader problem with the release of tslib 1.12.0. I hope Microsoft releases a patch soon.
We are using ionic 4.7.1 and getting the pathExists error for anyone trying to install ionic the old way. @dwieeb when you say "The Ionic CLI supports all versions of the Ionic Framework and breaking changes are minimal (mostly related to changing the minimum NodeJS version)." When I've tried to install the new cli with version 4.7.1 specifically, it does not exist. We are not ready to upgrade yet for our released version and now we cannot even have it in development without getting the pathExists error. Any suggestions? Have also tried updating tslib and downgrading per the suggestion above to 4.0.1.
Activity
s3ppo commentedon May 12, 2020
i have the same issue
edit:
i tried to rollback to an older version with npm cache reset but its still not working any more
i am on MacOS
Pin Ionic cli version
ChokeBilly commentedon May 12, 2020
Me too
(using MacOS)
roman-rr commentedon May 12, 2020
Error appears always with any command start with
$ ionicMonoHearted commentedon May 12, 2020
Same issue, on macOS Catalina. I created a thread on the forum a bit ago as well:
https://forum.ionicframework.com/t/ionic-cli-typeerror/189272
liamplm commentedon May 12, 2020
Same issue on Linux
jeanpfs commentedon May 12, 2020
Same issue on Windows 10
imhoffd commentedon May 12, 2020
Looks like an incompatibility between
tslib1.12.0 and our FS utility library. I've pinned tslib, which should fix the issue for now.Please update the Ionic CLI to fix the issue:
TMarafon commentedon May 12, 2020
Even updating to 6.9.1 the problem still persists.
imhoffd commentedon May 12, 2020
Maybe try
netowp commentedon May 12, 2020
If you are still having problems to execute
ionic serveor similar commands, do anpm install tslib@1.11.0that should solve that issue, right after doing @dwieeb solution.TMarafon commentedon May 12, 2020
Ok, @netowp 's suggestion solved my issue when running
ionic serve, howeverionic cordova build iosis still failing.imhoffd commentedon May 12, 2020
@TMarafon That's a separate issue.
asharm52 commentedon May 12, 2020
I've done the step mentioned by @dwieeb and followed it up with the one by @netowp , but am still getting:
MechanicalMann commentedon May 12, 2020
@dwieeb I discovered this issue because we are encountering the same error in a project that is still using the deprecated Ionic CLI (v5.4.16). You mentioned that the issue appears to be an incompatibility between
tsliband@ionic/utils-fs. That would explain why we are also experiencing the problem.Would it be possible to pin
tsliband publish a fix to the@ionic/utils-fslibrary instead of the downstream packages? That would address the problem for us and probably more broadly.AleFons commentedon May 13, 2020
@malorisdead I'm also using a deprecated CLI and pinning
tslibdidn't work for me.dmoreno85 commentedon May 13, 2020
npm uninstall ionic
npm cache clear --force
npm install -g @ionic/cli@6.9.1
This works for me!!
stewx commentedon May 13, 2020
We are on
ionic@4.12.0and our pipeline is broken because of this. Setting thetslibversion to1.11.2locally and globally has not resolved it.srinivasangurukannan commentedon May 13, 2020
I tried uninstall 6.9.1 and downgrade various versions.
At present 6.0.0. its failing..
Install of tslib also didnt work ..
Kindly help me to address the issues
imhoffd commentedon May 13, 2020
@malorisdead
Unfortunately we use exact versions of
@ionic/utils-*dependencies (see 5.4.16's package.json), so we'd have to do a full CLI release.I would bet this problem will fix itself as this comment suggests a
tslibfix is coming soon: microsoft/tslib#102 (comment)You can also follow the issue I created here: microsoft/tslib#103
If you're using an old CLI version, is there a reason you're not using the latest? The Ionic CLI supports all versions of the Ionic Framework and breaking changes are minimal (mostly related to changing the minimum NodeJS version).
MechanicalMann commentedon May 13, 2020
In our case, it was a CI pipeline that was using the deprecated version. Since the deprecation happened recently but our builds were unaffected, our devops team considered upgrading to be a low priority. Due to this issue we have now upgraded to 6.9.1 and the issue is resolved for us.
Thank you for clarifying the package dependencies and linking to the associated tslib issues. It seems that this is a much broader problem with the release of tslib
1.12.0. I hope Microsoft releases a patch soon.stewx commentedon May 13, 2020
I fixed our problem by downgrading to ionic@4.0.1
sarasailors commentedon May 13, 2020
We are using ionic 4.7.1 and getting the pathExists error for anyone trying to install ionic the old way. @dwieeb when you say "The Ionic CLI supports all versions of the Ionic Framework and breaking changes are minimal (mostly related to changing the minimum NodeJS version)." When I've tried to install the new cli with version 4.7.1 specifically, it does not exist. We are not ready to upgrade yet for our released version and now we cannot even have it in development without getting the pathExists error. Any suggestions? Have also tried updating tslib and downgrading per the suggestion above to 4.0.1.