6

I have installed npm 3.10.10 then i have installed ionic 3.9.2 and cordova 7.0.1.

i have tried the following steps:

  1. ionic start newProject

    (selected a tabs project)

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

  1. ionic serve

this command will throw the error

Error: Cannot find module 'E:\firstProject\node_modules\@ionic\app-scripts'

i found only this thread Error: Cannot find module '@ionic/app-scripts'.

i don't want to downgrade my nodejs version,as i want to use latest feature

but i tried,

npm i @ionic/app-scripts (SAG Answer)

i'm getting same error after executing above command

please help me without downgrading nodejs version

EDIT 1 (as per sampath suggestion) : below is my package.json file

{
  "name": "firstProject",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.1.3",
    "@angular/compiler": "4.1.3",
    "@angular/compiler-cli": "4.1.3",
    "@angular/core": "4.1.3",
    "@angular/forms": "4.1.3",
    "@angular/http": "4.1.3",
    "@angular/platform-browser": "4.1.3",
    "@angular/platform-browser-dynamic": "4.1.3",
    "@ionic-native/core": "3.12.1",
    "@ionic-native/splash-screen": "3.12.1",
    "@ionic-native/status-bar": "3.12.1",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.6.0",
    "ionicons": "3.0.0",
    "rxjs": "5.4.0",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@ionic/app-scripts": "2.1.4",
    "typescript": "2.3.4"
  },
  "description": "An Ionic project"
}

when i run ionic info it is giving some kind of error

$ ionic info

enter image description here

EDIT 2: (After sampath Answer)

  1. i did the following changes
i removed `"@ionic/app-scripts": "2.1.4"`
  1. $ npm install @ionic/app-scripts@latest --save-dev

enter image description here

enter image description here

enter image description here

post $ npm install @ionic/app-scripts@latest --save-dev , package.json file will look like below

enter image description here

please help me thanks in advance!!!!

5
  • Can you show the package.json file and ionic info? Commented Sep 3, 2017 at 9:05
  • hi sampath you can see it at EDIT1 Commented Sep 3, 2017 at 9:10
  • sampath please help me with the above error Commented Sep 3, 2017 at 9:23
  • Did you solve your issue? I am having the same problem Commented Mar 12, 2018 at 20:02
  • In my case I had set NODE_ENV=production in my terminal. To check value of NODE_ENV, echo $NODE_ENV, change it back to development with NODE_ENV=development. Commented Mar 20, 2019 at 0:59

6 Answers 6

8

Guys i solved this issue. Just want to share with you to save your time at least. Follow steps.

  1. Remove node_modules.
  2. Downgrade Node to version 6 (run npm install node@6 or brew install node@6)
  3. Add "@ionic/app-scripts": "3.1.9" under dependencies in project.json
  4. npm i
Sign up to request clarification or add additional context in comments.

2 Comments

After struggling with this issue for very long finally, this solution worked.
@Muhammed: i got above error :after :npm install node@6 but i got above error:npm ERR! [email protected] preinstall: node installArchSpecificPackage?
6

Remove "@ionic/app-scripts": "2.1.4" from your package.json file firstly.

According to your ionic info, you have a problem with app-scripts.So you can install latest as shown below.

and after that compile:

npm install @ionic/app-scripts@latest --save-dev

Remove "@ionic/app-scripts": "2.1.4" from your package.json file firstly.

Update from Git

Running on Windows you might try:

  1. Set environment in local command window and verify problem:

    set OPENSSL_CONF=c:\dummy
    npm -v

=> you now probably see this ssl error message

  1. Remove environment and verify problem is gone:

    set OPENSSL_CONF=npm -v

=> no ssl error message

6 Comments

hi sampath, i'm still getting the same error after following your steps. please look into that, thanks in advance
Do you have the internet on your machine?
yes i do have i'm able install the npm install @ionic/app-scripts@latest --save-dev the package
Can you try Update section above? See the git issue too.
your above update is working, therefore im not getting any junk message in cosole . does this solve my original problem?
|
5

Only install the latest version of @ionic/app-scripts

npm install @ionic/app-scripts@latest --save-dev

Comments

4

Run:

npm install @ionic/app-scripts@latest --save-

to install app-script.

Then:

npm install

To install node_modules to avoid Typescript error

And it worked for me.

Comments

0

try deleting node_modules folder and do npm install again this might solve your problem

3 Comments

i have tried this but getting same error when i execute ionic serve the error is Error: Cannot find module 'E:\firstProject\node_modules\@ionic\app-scripts
i think you should try reinstalling ionic npm uninstall ionic -g then npm install ionic -g
i have tried that but still same error. please help me if have any further solution
0

I had the same error. I tried update npm , reinstall app-script. I uninstalled node and npm, and then installed again and work it. I think that error was because the version of npm instaltion was diferent to the original instalation of node

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.