Can't install or run Ionic after accidentally reinstalling it - ionic-framework

I had ionic installed and running properly.
Accidentally I installed beta version
npm install ionic#beta
I did that without having CMD run with administrator, after that ionic command wasn't being recognized anymore, so I tried installing ionic again, but no luck, I tried uninstalling it and then installing it again but also no luck, the error I get when I install it:
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\{user}\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ionic"
npm ERR! node v6.9.4
npm ERR! npm v4.1.1
npm ERR! path C:\Users\{user}\AppData\Roaming\npm\node_modules\.staging\ansi-313f575d
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\{user}\AppData\Roaming\npm\node_modules\.staging\ansi-313f575d' -> 'C:\Users\{user}\AppData\Roaming\npm\node_modules\ionic\node_modules\cordova-lib\node_modules\ansi'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\{user}\AppData\Roaming\npm\node_modules\.staging\ansi-313f575d' -> 'C:\Users\{user}\AppData\Roaming\npm\node_modules\ionic\node_modules\cordova-lib\node_modules\ansi'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.

The issue was because when installed beta version without administrator privilege it created PATH variable in user scope which points only to npm directory, and this variable overrides the system PATH variable so CMD uses the user scope one, which causes ionic installation to fail.
Deleting the user's scope PATH variable and re-installing ionic fixed the issue.

Related

meteor create project failing

os: window 10
when I create meteor project, it shows following error. So I can not learn Meteor.
C:\test>meteor create asd
C:\Users\msm08\AppData\Local\.meteor\packages\meteor-tool\1.6.1\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:218
throw error;
^
Error: Error: Could not install npm dependencies for test-packages: Command failed: C:\WINDOWS\system32\cmd.exe /c C:\Users\msm08\AppData\Local\.meteor\packages\meteor-tool\1.6.1\mt-os.windows.x86_64\dev_bundle\bin\npm.cmd install --production=false
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\msm08\AppData\Roaming\npm-cache\_logs\2018-04-01T17_24_26_459Z-debug.log
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\msm08\AppData\Roaming\npm-cache\_logs\2018-04-01T17_24_26_459Z-debug.log
at Object.error (C:\tools\utils\buildmessage.js:430:11)
at C:\tools\cli\default-npm-deps.js:36:20
at C:\tools\utils\buildmessage.js:334:18
at exports.EnvironmentVariable.withValue (C:\tools\utils\fiber-helpers.js:89:14)
at C:\tools\utils\buildmessage.js:333:36
at exports.EnvironmentVariable.withValue (C:\tools\utils\fiber-helpers.js:89:14)
at Object.enterJob (C:\tools\utils\buildmessage.js:324:26)
at Object.install (C:\tools\cli\default-npm-deps.js:27:27)
at Command.func (C:\tools\cli\commands.js:801:36)
at C:\tools\cli\main.js:1523:15
Check the $path if it contains a Git:
go to this pc -> advanced System Setting -> Environmental Variables
check the Path if it contains GIT.
you can also check it via command prompt and type "Path"
You simply have to install the GIT for windows version from this LINK
It will automatically set the environment variable for GIT on your windows 10 machine. You do not have to do anything else.

Issus Ionic Cordova platform add IOS

ionic Cordova platform and IOS
✖ Cordova platform adds ios --save - failed!
[ERROR] Exception: Using Cordova-fetch for Cordova-ios#^4.4.0
Error: Failed to fetch platform `cordova-ios#^4.4.0`
Probably this is either a connection problem or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 254 Error output:
npm ERR! path
/Users/zion/Desktop/RSSFeederApp/node_modules/node_modules/file:cordova-dist-dev/CB-11690/cordova-common-1.4.1.tgz
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall stat
npm ERR! enoent ENOENT: no such file or directory, stat
'/Users/zion/Desktop/RSSFeederApp/node_modules/node_modules/file:cordova-dist-dev/CB-11690/cordova-common-1.4.1.tgz'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zion/.npm/_logs/2017-08-31T07_48_01_154Z-debug.log
This issue is related to npm 5.3.0.
It is best to downgrade to 5.2.0 using npm install -g npm#5.2.0
For us this is most commonly caused by npm's broken lockfile approach.
To resolve it, delete the package-lock.json and run your command again.
try this, and make sure you are using Mac
ionic platform add ios

Ionic is not recognized as an internal or external command

how to resolve can i fixed it . i already install cordova and ionic global
C:\Users\sever>npm install -g ionic
npm ERR! not a package C:\Users\sever\ionic
npm ERR! addLocal Could not install C:\Users\sever\ionic
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\sever\node_modu
les\npm\bin\npm-cli.js" "install" "-g" "ionic"
npm ERR! node v5.1.1
npm ERR! npm v3.9.3
npm ERR! path C:\Users\sever\AppData\Local\Temp\npm-5068-24aad619\unpack-77f32b4
3\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\sever\AppData\
Local\Temp\npm-5068-24aad619\unpack-77f32b43\package.json'
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\sever\AppData\
Local\Temp\npm-5068-24aad619\unpack-77f32b43\package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\sever\npm-debug.log
you just have to run
npm install -g cordova
and
npm install -g ionic
And then in windows you have to reopen the cmd window, else the changes aren't noticed.
My problem is npm -v is 3.10.8, which is lower than 4, causing me npm install -g ionic cordova always fail. Giving error like below.
'ionic' is not recognized as an internal or external command, ...
After I run npm install -g npm everything seem fine, and now I can run npm install -g ionic cordova

trying to install mongodb via npm and getting EINVAL errors

I'm trying to install packages using NPM. For example I'm trying to get install mongodb on ubuntu 14.04 by the usual
Sudo npm install mongodb
I get this error
npm ERR! tar.unpack untar error /home/cougs/.npm/mongodb/2.0.45/package.tgz
npm ERR! Linux 3.13.0-61-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "mongodb"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! path /mnt/nfs_data/byucougars.com/RebelFleet/app/node_modules/mongodb/package.json
npm ERR! code EINVAL
npm ERR! errno -22
npm ERR! syscall chown
npm ERR! EINVAL: invalid argument, chown '/mnt/nfs_data/byucougars.com/RebelFleet/app/node_modules/mongodb/package.json'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /mnt/nfs_data/byucougars.com/RebelFleet/app/npm-debug.log
I'm pretty sure it's a permission issue with my user. probably when I copied stuff to the server via FTP, it screwed things up stuff. I just have no idea how to fix this.
One way to fix this would be to override chown() by LD_PRELOAD to interpose a function which always returns zero ("success"). So instead of
#npm install
you would do
#echo "int chown() { return 0; }" > preload.c && gcc -shared -o preload.so preload.c
#LD_PRELOAD=$PWD/preload.so npm install
I figured out that my code was running on a MNT nfs server using version 4.0. Which changes all permissions to nobody and it was causing the issue to repeat every time I try to fix it. So I just migrated the code back to the original server and it worked fine after that.

Npm install directly from Github Error: ENOENT

I'm running an example from build-nodejs-npm-installation-package-scratch. Instead of uploading to npm repository I'm putting it on Github and trying to download it via npm instead. I run npm install git+https://github.com/t2wu/replaceme.git and got the following:
npm ERR! Error: ENOENT, chmod '/private/tmp/node_modules/replaceme_tim/replaceme.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "git+https://github.com/t2wu/replaceme.git"
npm ERR! cwd /private/tmp
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /private/tmp/node_modules/replaceme_tim/replaceme.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/tmp/npm-debug.log
npm ERR! not ok code 0
I have a package.json in there, I cannot figure out what is wrong.
EDIT: I can install Express OK, but I can't install my practice module
This happens due to missing permissions or unlinked files while npm was working. This topicc is also seen at github, here.
Try running with admin perms.