Vue : command not found after installing #vue/cli - vue.js

I don't know why isn't working for me. I opened powershell as administrator and run npm install -g #vue/cli. I have done uninstalling vue-cli and restalling again doesn't work. Here is my error
PS C:\WINDOWS\system32> npm install -g #vue/cli
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
C:\Users\Lin Aung\AppData\Roaming\npm\vue -> C:\Users\Lin Aung\AppData\Roaming\npm\node_modules\#vue\cli\bin\vue.js
> protobufjs#6.8.8 postinstall C:\Users\Lin Aung\AppData\Roaming\npm\node_modules\#vue\cli\node_modules\protobufjs
> node scripts/postinstall
> nodemon#1.18.10 postinstall C:\Users\Lin Aung\AppData\Roaming\npm\node_modules\#vue\cli\node_modules\nodemon
> node bin/postinstall || exit 0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules\#vue\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ #vue/cli#3.5.0
added 680 packages from 509 contributors in 172.749s
PS C:\WINDOWS\system32> vue
vue : The term 'vue' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ vue
+ ~~~
+ CategoryInfo : ObjectNotFound: (vue:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\WINDOWS\system32>

Adding %APPDATA%\npm to the PATH fixed my problem

install using sudo
sudo yarn global add #vue/cli

At windows:
First step: %path%;%appdata%\npm;C:\Program Files\nodejs;C:\Users\User.npm-global;C:\Program Files (x86)\bin\
in environment variable
second step: https://classic.yarnpkg.com/en/docs/install/#windows-stable
install yarn or npm
third step: run window shell as administrator
set-executionpolicy unrestricted
Forth step : yarn global add #vue/cli
Result:
C:\Users\User>vue --version
#vue/cli 4.5.15

Related

I can't install sanity through VS Code

When I try to install Sanity with the offered command (npm install -g #sanity/cli sanity init --coupon javascriptmastery2022) from the web page(https://www.sanity.io/javascriptmastery2022) through CLI it doesn't work, I receive this information on CLI:
Unrecognized token in source text.
At line:1 char:16
+ npm install -g <<<< #sanity/cli
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordExce
ption
+ FullyQualifiedErrorId : UnrecognizedToken
The command on the website includes && between the npm install command and the sanity init command. Are you including it?
If you're on Windows, you may need to run them as two separate commands:
npm install -g #sanity/cli
Then once that's done:
sanity init --coupon javascriptmastery2022

Nodemon: command not found

I am struggling to install nodemon on my node.js server. I am running the command npm install nodemon -g and the output is the following:
C:\Users\Stoffe\AppData\Roaming\npm\nodemon -> C:\Users\Stoffe\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js
> nodemon#1.18.5 postinstall
C:\Users\Stoffe\AppData\Roaming\npm\node_modules\nodemon
> node bin/postinstall || exit 0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4
(node_modules\nodemon\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} )
+ nodemon#1.18.5
updated 1 package in 9.223s
But the problem is, when I do nodemon index.js, I get the error bash: sudo: command not found. I have searched around without any luck and I am yet to find a working solution. Any help is appreciated!
Don't install global npm modules using the git bash terminal
Reinstall node.js/npm and npm install nodemon -g if where nodemon in cmd prompt returns INFO: Could not find files for the given pattern(s).
If all else fails, ensure that the file is being downloaded and is in your C:\Users\{{YOURUSER}}\AppData\Roaming\npm\nodemon.cmd folder.
Finally, ensure that your windows path environment variable has a folder set to that \AppData\Roaming\npm folder.
If all else fails, you probably have a typo or reached the max path environment variable limit for your operating system (i.e. 4096 characters for windows 7)

electron install error : Generated checksum for "electron-v2.0.2-win32-x64.zip" did not match expected checksum

I want to install latest electron version in my existing angular application.So I followed npm command to install it.
Command : npm i electron#latest
Expected Behavior
Electron should installed successfully.
Actual Behavior
So, Whenever I tried to install electron, after downloading zip file and SAMSUN.txt file , it is throwing below error....
Error: Generated checksum for "electron-v2.0.2-win32-x64.zip" did not match expected checksum.
at ChecksumMismatchError.ErrorWithFilename (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:41:124)
at new ChecksumMismatchError (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:56:133)
at Hash. (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:203:22)
at emitNone (events.js:106:13)
at Hash.emit (events.js:208:7)
at emitReadable_ (_stream_readable.js:513:10)
at emitReadable (_stream_readable.js:507:7)
at addChunk (_stream_readable.js:274:7)
at readableAddChunk (_stream_readable.js:250:11)
at Hash.Readable.push (_stream_readable.js:208:10)
Please note that I have tried to clear my npm cache using npm cache clean --force command and tried to install. but it didn't work.
I also tried to install electron globally using npm i -g electron#latest, but that approach also didn't work.
Please provide solution as soon as possible because I m really stuck at this problem.
Electron Version: 2.0.2
Operating System : windows
node version : 8.11.2
npm version : 6.1.0
Last known working Electron version:
We can solve this issue by using following steps (OS - Windows 10)
Delete "SHASUMS256.txt-x.x.xx" file from "C:\Users{{UserName}}.electron".
Delete Cache folder from "C:\Users{{UserName}}\AppData\Local\electron".
Delete electron from node_modules folder.
Then install electron globally and locally by using following commands -
npm init -y //Note: The -y flag provides default options automatically
npm install electron -g //install electron globally
npm install electron --save-dev --save-exact //install electron as devdependencies
If you are using typescript then install it as global using below command-
npm install -g typescript
Above steps may help you.

How to run npm after installing

I want to run npm pakage after installing
c:/>npm i -g pakagename
c:/>pakagename parameters
but I got error 'packagename' is not recognized as an internal or external command,
operable program or batch file.
try : npm install <package-name> -g
it will install that package globally to your system
then check it by checking its version. like
package --version
then do whatever you want
like : https://stackoverflow.com/a/15157360/6747191
To run your installed package with npm you can run it by this command
npm run-script <command> [-- <args>...]
Alias: npm run <command>
According to this documentation: https://docs.npmjs.com/cli/run-script

Failed optional dependency /chokidar/fsevents:

I am installing "cordova-plugin-geolocation" via npm but "cordova-plugin-geolocation" is unable to install. I am seeing the following warnings:
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.14
Is there any possible solution?
I used the following command to install NPM dependencies with the parameter NO-OPTIONAL
npm install --no-optional
source:
https://github.com/ariesjia/grunt-riot/issues/16
Make .npmignore with
node_modules
chokidar/fsevents
inside
I was getting this error when I run gulp command
Error: watch node_modules/bootstrap/scss/bootstrap.scss ENOSPC
at _errnoException (util.js:1022:11)
at FSWatcher.start (fs.js:1382:19)
at Object.fs.watch (fs.js:1408:11)
at createFsWatchInstance
I ran this and it works for me
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p