Npm ERR! enoent ENOENT: no such file or directory


#1

I did. Unfortunately nothing run on the device, error:

[INFO] Starting app-scripts server: --port 8100 --p 8100 --livereload-port 35729
       --r 35729 --address 0.0.0.0 - Ctrl+C to cancel
[11:40:38]  watch started ...
[11:40:38]  build dev started ...
[11:40:38]  clean started ...
[11:40:38]  clean finished in 16 ms
[11:40:38]  copy started ...
[11:40:38]  transpile started ...
[11:40:42]  typescript: s:/IonicProject/VerificheNawi/src/app/app.component.ts, line: 2
            Cannot find module 'ionic-angular'.

       L1:  import { Component } from '@angular/core';
       L2:  import { Platform } from 'ionic-angular';
       L3:  import { StatusBar } from '@ionic-native/status-bar';

I’m going to (try to) fix it.


Ionic 3.5.0 was released!
Ionic 3.5.0 was released!
Ionic 3.5.0 was released!
#2

check your package.json to see if ionic-angular is correct declared, then I would reinstall all the libs

rm -r node_modules
npm install

#3

I’m doing it just now, thanks!
(under windows, unfortunately)


#4

I’ve got in npm install:

npm ERR! path s:\IonicProject\VerificheNawi\node_modules\ionic-angular
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 's:\IonicProject\VerificheNawi\node_modules\ionic-angular' -> 's:\IonicProject\VerificheNawi\node_modules\.ionic-angular.DELETE'
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!     C:\Users\Pietro\AppData\Roaming\npm-cache\_logs\2017-06-30T10_13_25_714Z-debug.log

And the log:

............................
13156 verbose npm  v5.0.4
13157 error path s:\IonicProject\VerificheNawi\node_modules\ionic-angular
13158 error code ENOENT
13159 error errno -4058
13160 error syscall rename
13161 error enoent ENOENT: no such file or directory, rename 's:\IonicProject\VerificheNawi\node_modules\ionic-angular' -> 's:\IonicProject\VerificheNawi\node_modules\.ionic-angular.DELETE'
13162 error enoent This is related to npm not being able to find a file.
13163 verbose exit [ -4058, true ]

I’m afraid I’ll have to install node by scatch :disappointed_relieved:


#5

Were you able to fully remove node_modules before launching an install again?

I read there that some guy are facing same here with npm5


#6

maybe doing a

npm cache clean 

?


#7

Did you close all other software while doing the npm stuff? For me, Visual Studio Code sometimes brakes file operations on /node_modules for example.


#8

Thanks to all.

I agree, Visual Studio Code have to be closed, it try to update typescript analysis meanwhile npm is installing.
But was not the case. And I’m sure Node_modules has been deleted (with Total Commander).
I had to uninstall an reinstall Ionic and Cordova, then npm install had run correctly.

This in situation now (ionic info):

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.8
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.2.3
Ionic Framework                 : ionic-angular 3.4.2

System:

Node       : v6.11.0
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 5.0.4

Why 3.4.2? Latest is 3.5 or not?? So I did again:

npm install ionic-angular@3.5.0 --save --save-exact
npm install @ionic/app-scripts@latest --save-dev

Ionic framework now is:

Ionic Framework : ionic-angular 3.5.0
@ionic/app-scripts : 1.3.12

I expected 1.3.9 !! However Ionic serve OK.

About build or running on Emulator/Devices I’m still facing the problem:

Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio

I had immediately after upgrade to 3.4, but there are a lot of threads about it (none resolve…)


#9

Why? You installed latest, and 1.3.12 is latest right now…[quote=“pimol, post:18, topic:96186”]
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio

I had immediately after upgrade to 3.4, but there are a lot of threads about it (none resolve…)
[/quote]

Please create a new thread for that. But I can alread tell you the advice will be to use Android Studio to install everything - then it will just work.


#10

I didn’t start a new thread because there are so many about it… I’m following those
I install Android studio from scratch. But I can run only until framework 3.1.0 with script 1.3.0

BTW: I expected 1.3.9 because was the one mentioned in 3.5 announcement :innocent:


#11

Yep, that was quite some time ago in app-scripts time :wink: There were some bugfixes and fixes to the fixes.[quote=“pimol, post:10, topic:96447”]
I didn’t start a new thread because there are so many about it… I’m following those
I install Android studio from scratch. But I can run only until framework 3.1.0 with script 1.3.0
[/quote]

The error you posted is actually from Cordova, not Ionic. So this has nothing to do with any Ionic package, but maybe with cordova-android or Cordova CLI - but most probably with your Android SDK installation.


#12

In the announcement it was 1.3.9 but straight after they published some bug fixes, that’s why 1.3.12 app-scripts is the right version to have