Onkar
Onkar

Reputation: 679

ERROR An error occurred while running npm i (exit code 1): Ionic Error

I followed this tutorial:

1.Node installed - node-v8.9.0-x86
2. ran command npm install -g cordova ionic

npm WARN deprecated [email protected]: Use uuid module instead
C:\Users\Android1\AppData\Roaming\npm\cordova -> 
C:\Users\Android1\AppData\Roaming\npm\node_modules\cordova\bin\cordova
C:\Users\Android1\AppData\Roaming\npm\ionic -> 
C:\Users\Android1\AppData\Roaming\npm\node_modules\ionic\bin\ionic
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] 
(node_modules\ionic\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
[email protected]: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"win32","arch":"ia32"})

+ [email protected]
+ [email protected]
added 115 packages and updated 2 packages in 69.815s
  1. Then ran command ionic start myApp tabs , got following Error

enter image description here

Thank you,

Upvotes: 7

Views: 47582

Answers (11)

Illuminati
Illuminati

Reputation: 548

My WSL machine has a problem detecting which gradlew process to run so I had to manually add '.bat' extension here:

enter image description here

Upvotes: 0

Michael Njuguna
Michael Njuguna

Reputation: 118

I started using react instead of angular and the error was gone.

Upvotes: 0

prabhu s
prabhu s

Reputation: 39

Solution:

step 1 : sudo -s

step 2 : sudo ionic start todo blank ( for ubuntu )

Upvotes: 1

Skenshee Noel
Skenshee Noel

Reputation: 1

The solution is

** Clear npm cache

**Delete package-lock.json file from your proyect

** Access your proyect

** Run yarn install

**You may have problems with your internet conection

Upvotes: 0

Shriya Madan
Shriya Madan

Reputation: 171

npm cache clean --force

This command worked for me.

Upvotes: 5

Atit More
Atit More

Reputation: 155

I was facing same problem. So, I installed my node module using yarn instead of npm. And it worked for me. Try it using [Yarn][1]

You can try it and check.

Thank You.

Upvotes: 1

Debasis Das
Debasis Das

Reputation: 569

Solution:

step 1 : sudo -s

step 2 : sudo ionic start todo blank ( for ubuntu )

Upvotes: 4

Prakash Palanisamy
Prakash Palanisamy

Reputation: 104

Please follow the simple procedure to solve this issue:

  • Delete

(1)npm and

(2)npm-cache

folders manually. [You can find it in => %AppData%/npm-cache on Windows.]

  • Uninstall the Node.Js application in Programs and Features in Windows-OS.

  • Restart the System.

  • Once again re-install Node.Js in your system, perfectly.

  • open terminal anywhere (preferably from Desktop) and run

node --version

and check it is latest version.

  • Run

npm --version

and check it is latest version.

  • Run

git--version

and check it is latest version.

  • Run

npm install -g ionic

  • Finally Run,

ionic start myApp tabs

Here ==>>wait for more time (8-10 mins)<<== until all the ionic files to be downloaded, install and create a new ionic app in the given name.

  • Finally, a new ionic project will be created.

  • Go to the project folder of that particular ionic project and Run

ionic serve

The project will run in Browser.

All the best, Devs ..!!!

Upvotes: 1

ngShravil.py
ngShravil.py

Reputation: 5058

Try running 'npm i' command in the project directory in sudo mode or administrator mode. This worked for me.

Upvotes: 0

Shubham Kandiyal
Shubham Kandiyal

Reputation: 340

I also face the same problem.

Solution is worked for me in Ubuntu 16.04:

sudo -s

First Get Access of Super User from Above Command

sudo ionic start myApp tabs

After Get into SUDO Mode, then run ionic command with sudo, like above

Thanks

Upvotes: 3

Onkar
Onkar

Reputation: 679

After spending more than day i came across many solutions, which are as follow

  1. Some developers solve this problem by, i downgraded node from v8 to v7.6.0 and all seems to work fine with ionic CLI. From Here but this solution not work for me.

  2. Run Command Line as Administrative, this solution is beneficial

  3. The Correct and well solution work for me, is to install install all node-gyp dependencies by following command

     $ npm install --global --production windows-build-tools
    

    and then install the package

     $ npm install --global node-gyp
    

Solution Link

Upvotes: 13

Related Questions