简体   繁体   中英

Why npm doesn't see quasar?

I installed quasar with a command: npm install -g @quasar/cli

Then I tried to create an app folder already with quasar: quasar create callapp

The console is run in Visual Studio Code (last version), with administrator rights. I have tried reinstalling npm. npm version - 6.9.0 node version - v11.13.0

Installing quasar:

PS C:\Users\Daniels> npm install -g @quasar/cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN rm not removing C:\Users\Daniels\AppData\Roaming\npm\quasar.cmd as it wasn't installed by C:\Users\Daniels\AppData\Roaming\npm\node_modules\@quasar\cli
npm WARN rm not removing C:\Users\Daniels\AppData\Roaming\npm\quasar as it wasn't installed by C:\Users\Daniels\AppData\Roaming\npm\node_modules\@quasar\cli
C:\Users\Daniels\AppData\Roaming\npm\quasar -> C:\Users\Daniels\AppData\Roaming\npm\node_modules\@quasar\cli\bin\quasar
+ @quasar/cli@1.0.0
updated 1 package in 14.635s

Creating app:

PS C:\Users\Daniels> quasar create callapp
quasar : Die Benennung "quasar" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die 
Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang.
In Zeile:1 Zeichen:1
+ quasar create callapp
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (quasar:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

So it says that "quasar wasn't found as a name of Cmdlet or function or script of the programm. Please check the path and try again".

I expect that npm just finds quasar cli and I can work with it...

I solved the problem with deleting node.js, deleting npm, restart of the system, installing another version of node.js (LTS Stable version), installing npm again.

Windows O/S make sure the "npm" data is part of %path%. SET PATH=%PATH%;C:\Users<your-id>\AppData\Roaming\npm

If you use yarn , run this command to set the path:

export PATH="$(yarn global bin):$PATH"

Then, you can use quasar .

in windows make sure to check your environment variables. In my case with windows 8.1 environment i have to add manually to PATH

Environment Variable

If you installed only the npm like:

npm i -g quasar

you need also install the quasar cli:

npm install -g @quasar/cli

For more info here: https://quasar.dev/quasar-cli/installation

If you are using ps as a command prompt, you should restart ps to use the commands when you add a new package.

Here's my solution:-

  • Install node.js (V16 worked for me)
  • Install Quasar npm install -g @quasar/cli
  • make sure you access global installed npm packages by adding a path entry in your system variables ie(C:\Users\yourname\AppData\Roaming\npm)

I had the same error message when I want to use quasar testing. In my case npx was the solution

npx quasar...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM