I am facing problem in running my first ionic project - ionic-framework

I am using mac
I tried to run my first ionic project , But I am facing erroe in running it in my mac
I am putting all the steps that I have followed into Terminal -
Started with - : $ ionic start MyIonicProject tutorial
$cd MyIonicProject
$ionic serve
then I am getting error
Error: EACCES: permission denied, open '/Users/user/.ionic/helper.log'
> ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[INFO] Looks like #ionic/app-scripts isn't installed in this project.
This package is required for this command to work properly.
? Install #ionic/app-scripts? Yes
> npm i -D -E #ionic/app-scripts
npm WARN deprecated hoek#2.16.3: The major version is no longer supported. Please update to 4.x or newer
npm WARN checkPermissions Missing write access to /Users/user/Projects/MyIonicProject/node_modules
npm WARN checkPermissions Missing write access to /Users/user/Projects/MyIonicProject/node_modules/#ionic
npm ERR! path /Users/user/Projects/MyIonicProject/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/user/Projects/MyIonicProject/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/Users/user/Projects/MyIonicProject/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/Users/user/Projects/MyIonicProject/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/Users/user/Projects/MyIonicProject/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2018-09-21T06_24_56_379Z-debug.log
users-MacBook-Pro-3:MyIonicProject user$

Try running command by appending sudo as follows:
sudo ionic serve
Or
run below command in the terminal window:
sudo chown -R $USER /usr/local/
This will change the permissions of every thing inside the local folder and then try below command:
sudo ionic serve

Looks like #ionic/app-scripts isn't installed in this project.
So try first this :
npm install #ionic/app-scripts#latest --save-dev
Then:
npm install
and
ionic serve -l

Related

Error running 'npm install -g firebase-tools'

I ran the following code on the terminal to instal firebase-tools
npm install -g firebase-tools
I am trying to install this to use cloud functions on firebase and I got these errors:
juan#juans-Air ~ % npm install -g firebase-tools
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/firebase-tools
npm ERR! dest /usr/local/lib/node_modules/.firebase-tools-ENG41nb9
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/firebase-tools' -> '/usr/local/lib/node_modules/.firebase-tools-ENG41nb9'
npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/firebase-tools' -> '/usr/local/lib/node_modules/.firebase-tools-ENG41nb9'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/firebase-tools',
npm ERR! dest: '/usr/local/lib/node_modules/.firebase-tools-ENG41nb9'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/juan/.npm/_logs/2022-10-30T02_59_24_185Z-debug-0.log
juan#juans-Air ~ %
Is there a different way to install this?
i ran it with sudo and it worked::
sudo npm install -g firebase-tools

Issues running Ionic on Macbook

I have been having issues running ionic on my MacBook. I have npm and node downloaded yet my system still doesn't seem to allow me to get Ionic to run. I have tried running it with the sudo command too.
When I run the command npm install -g ionic I get:
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/ionic
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ionic'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ionic'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/ionic'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Janelle/.npm/_logs/2022-03-27T18_13_54_411Z-debug-0.log
looks like ionic was not installed correctly initially, you can always try and remove ionic and re-install. You should not have to run it with sudo

Can't install Ionic 3

I couldn't install ionic. Can you help me?
Alexanders-MacBook-Air:~ alexander$ npm install -g #ionic/cli
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexander/.npm/_logs/2020-07-26T14_18_16_130Z-debug.log
Alexanders-MacBook-Air:~ alexander$
Require admin right to install ionic
sudo npm install ionic
Install latest version of ionic(version 5):
sudo npm install -g #ionic/cli
EACCES: permission denied
you need the root permission
$ su npm install -g ionic

Can not create ionic 2 app

I am following the ionic installation guide, but when I want to create app it give me error.
The command I enter is:
ionic start cutePuppyPics --v2
The error it gives is:
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v\\nodev7.0.0\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v7.0.0
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! node-sass#3.9.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.9.3 postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\nodeProjects\ionic\cutePuppyPics\npm-debug.log
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
Node v7.0.0 causes this problem. Instead of nodejs v7.0.0 use nodejs v6.9.1 or install LTS version of node from https://nodejs.org/en/download
You don't have to use --v2 when creating your project. Just type
ionic start cutePuppyPics blank
--v2 is not working with latest ionic. you can use
ionic start cutePuppyPics ionic-angular (for ionic 2.x)
ionic start cutePuppyPics ionic1 (ionic 1.x)

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.