Can't create a new project after updating ionic


#1

Hi I can’t seem to create a new project anymore. Existing projects continue to work.
The only change I did so far was to update to the latest ionic (as per this blog post)

Any ideas on what’s wrong? I’ve tried changing node to 8.4 as well, which worked just fine before whilst starting new projects (I use n to manage)

ionic start icon blank
Error: Cannot find module 'graceful-fs'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/archiver-utils/index.js:8:10)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)

ionic info

ionic info
[WARN] You are not in an Ionic project directory. Project context may be missing.

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

System:

    Node : v8.6.0
    npm  : 5.4.2 
    OS   : macOS Sierra

Misc:

    backend : legacy


#2

Add --verbose to that command and post its output.
What does npm list -g --depth=0 return?


#3

(Update - I went down the path of trying to install whatever package it said was missing - but that rabbit hole is never the real issue)

Output of ionic info --verbose

ionic info --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/pp/fiddle', local: false, binPath: '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: 
        '/usr/local/lib/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 23086)
[WARN] You are not in an Ionic project directory. Project context may be missing.

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

System:

    Node : v8.6.0
    npm  : 5.4.2 
    OS   : macOS Sierra

Misc:

    backend : legacy

Output of ionic start myapp blank --verbose

ionic start myapp blank --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/pp/fiddle', local: false, binPath: '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: 
        '/usr/local/lib/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 23086)
[INFO] Fetching app base (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)
✖ Downloading - failed!
TypeError: tar.Extract is not a function
    at Promise (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/utils/archive.js:47:44)
    at Promise (<anonymous>)
    at /usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/utils/archive.js:46:16
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:93:62)
    at <anonymous>
[DEBUG] TypeError: tar.Extract is not a function
            at Promise (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/utils/archive.js:47:44)
            at Promise (<anonymous>)
            at /usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/utils/archive.js:46:16
            at Generator.next (<anonymous>)
            at fulfilled (/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:93:62)
            at <anonymous>

Output of npm list -g --depth=0


#4

Your installations seem to be totally shot. Normally an Ionic dev will have only npm, ionic and cordova here.

I would just dump everything (uninstall node) and begin new with a new node installation with nvm. Then reinstall Ionic and Cordova, your initial problem will be solved then.


#5

I agree. Too much to dive into and debug. I just removed everything (cordova, node,npm, n) and reinstalled - all good again. thanks.