Closed george-martinec closed 1 year ago
Hi @george-martinec ,
This will be one of the following:
package.json
and make sure if @ionic/cli
is listed that you have at least version 7 installed.npm list -g
and see if the version you have installed globally is at least version 7.The error message is essentially saying that the project type of vue-vite is unknown, this was added in v7 of Ionic CLI and the error will only be caused if the ionic version installed is not v7.
Hi @dtarnawsky,
ionic -g
_ _
(_) ___ _ __ (_) ___
| |/ _ \| '_ \| |/ __|
| | (_) | | | | | (__
|_|\___/|_| |_|_|\___| CLI 7.0.1
...
package.json
...
"dependencies": {
"@capacitor/android": "4.7.3",
"@ionic/cli": "7.0.1",
"@capacitor/app": "4.1.1",
"@capacitor/core": "4.7.3",
"@capacitor/haptics": "4.1.0",
"@capacitor/keyboard": "4.1.1",
"@capacitor/status-bar": "4.1.1",
"@ionic/vue": "^7.0.0",
"@ionic/vue-router": "^7.0.0",
"ionicons": "^7.0.0",
"vue": "^3.2.45",
"vue-router": "^4.1.6"
},
"devDependencies": {
"@capacitor/cli": "4.7.3",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/eslint-config-typescript": "^11.0.2",
"@vue/test-utils": "^2.3.0",
"cypress": "^12.7.0",
"eslint": "^8.35.0",
"eslint-plugin-vue": "^9.9.0",
"jsdom": "^21.1.0",
"typescript": "^4.9.3",
"vite": "^4.1.0",
"vitest": "^0.29.2",
"vue-tsc": "^1.0.24"
},
...
I disabled the extension and restarted VSCode, then I Uninstall the extension and restarted VSCode, then I install the extension again, same issue.
I even created a new blank app via ionic start, same issue.
ionic info
[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module '@capacitor/ios/package.json'
Require stack:
- /home/myUserName/.nvm/versions/node/v19.0.0/lib/node_modules/@ionic/cli/lib/project/index.js
- /home/myUserName/.nvm/versions/node/v19.0.0/lib/node_modules/@ionic/cli/lib/index.js
- /home/myUserName/.nvm/versions/node/v19.0.0/lib/node_modules/@ionic/cli/index.js
- /home/myUserName/.nvm/versions/node/v19.0.0/lib/node_modules/@ionic/cli/bin/ionic
Ionic:
Ionic CLI : 7.0.1 (/home/myUserName/.nvm/versions/node/v19.0.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 7.0.2
Capacitor:
Capacitor CLI : 4.7.3
@capacitor/android : 4.7.3
@capacitor/core : 4.7.3
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.7.2
System:
NodeJS : v19.0.0 (/home/myUserName/.nvm/versions/node/v19.0.0/bin/node)
npm : 8.19.2
OS : Linux 5.19
Is there a particular operation you are doing to get the error message to appear? does this appear in the output window or somewhere else?
tried VSCode terminal, tried terminal in Ubuntu 22, same error
Actually I am using nvm to change node version, so how do the extension get the node path ?
Ok. So, version 1.35.0 has a built in version of the Ionic CLI which is version 7 and knows about vue-vite as a starter. So, any commands that you run from the extension should work.
When you run from the VS Code terminal or terminal in Ubuntu it relying on its shell to know where to run the command "ionic" from.
In your particular setup it is finding a version 6 version of the CLI somewhere. Your mission is to find how its getting to that path and remove the v6 cli or replace it with v7.
Found it @dtarnawsky !
VSCode was using wrong version of node, when using nvm on Ubuntu Linux use
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Do you have a .nvmrc file in your project? If so, the extension will try to switch version of node whenever something is run.
Sounds like you worked out the problem though and why it was picking up the wrong path.
ionic.config.json
Extension version:
Tried: