2017-09-03 199 views
2

我已經安裝了npm 3.10.10,然後我有installed ionic 3.9.2cordova 7.0.1找不到module node_modules @ionic app-scripts IONIC 3

我已經嘗試以下步驟:

  1. ionic start newProject

    (選擇了製表符項目)

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

  • ionic serve
  • 此命令將throwerror

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

    我只找到這個線程Error: Cannot find module '@ionic/app-scripts'

    我不想我的降級版本的NodeJS,因爲我想使用最新的功能

    但我想,

    npm i @ionic/app-scriptsSAG回答

    我是在執行完之後得到相同的errorcommand

    請求SE幫我沒有降級nodejsversion

    EDIT 1(按薩姆帕斯建議):下面是我package.json文件

    { 
        "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" 
    } 
    

    當我運行ionic info它給了某種錯誤

    $ ionic info

    enter image description here

    編輯2:(後薩姆帕斯應答)

    1. 我做了以下改變
    i removed `"@ionic/app-scripts": "2.1.4"` 
    
  • $ npm install @ionic/[email protected] --save-dev

  • enter image description here

    enter image description here

    enter image description here

    post $ npm install @ionic/[email protected] --save-dev , package.json file will look like below

    enter image description here

    請幫我在此先感謝!!!!

    +0

    你可以顯示'package.json'文件和'離子信息'嗎? – Sampath

    +0

    喜薩姆帕斯你可以看到它在** ** EDIT1 – EaB

    +0

    薩姆帕斯請幫我與上面​​的'error' – EaB

    回答

    0

    嘗試刪除node_modules文件夾並做npm install再次這可能會解決你的問題

    +0

    我都試過,但得到相同的'error'當我執行'離子serve'錯誤是'錯誤:無法找到模塊「E:\ firstProject \ node_modules \ @ionic \ APP-scripts' – EaB

    +0

    我想你應該嘗試重新安裝離子'NPM卸載離子-g''然後安裝NPM離子-g' – ganesh

    +0

    我已經試過了,但還是一樣'error' 。請幫助我,如果有任何進一步的解決方案 – EaB

    2

    package.json文件中刪除"@ionic/app-scripts": "2.1.4"首先。

    根據您的ionic info,您遇到了app-scripts的問題。因此,您可以安裝latest,如下所示。

    和編譯後:

    npm install @ionic/[email protected] --save-dev 
    

    package.json文件中刪除"@ionic/app-scripts": "2.1.4"首先。

    更新from Git

    在Windows上運行,你可以嘗試:在本地命令窗口

    1. 設置環境和驗證問題:

      set OPENSSL_CONF=c:\dummy
      npm -v

    =>你現在可能看到此SSL錯誤消息

  • 刪除環境並驗證問題已經一去不復返了:

    set OPENSSL_CONF=npm -v

  • =>無ssl錯誤信息

    +0

    嗨sampath,我仍然得到相同的錯誤後,你的步驟。請看看,請提前致謝 – EaB

    +0

    請參閱**更新2 ** – EaB

    +0

    您的計算機上有互聯網嗎? – Sampath

    0

    運行:

    npm install @ionic/[email protected] --save- 
    

    安裝app-script

    然後:

    npm install 
    

    要安裝node_modules避免打字稿錯誤

    而且它爲我工作。