Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug and Error for Create Sample Project! #12294

Closed
QuestionPython opened this issue Jul 8, 2017 · 34 comments
Closed

Bug and Error for Create Sample Project! #12294

QuestionPython opened this issue Jul 8, 2017 · 34 comments

Comments

@QuestionPython
Copy link

OS: Arch Linux
Kernel: x86_64 Linux 4.11.3-1-ARCH


$ node -v

v8.1.3

$ ionic start myApp tabs

module.js:487
    throw err;
    ^

Error: Cannot find module 'minimatch'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/glob/glob.js:45:17)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
@QuestionPython
Copy link
Author

QuestionPython commented Jul 8, 2017

Try reinstall npm

again:

$ ionic start myApp tabs

module.js:487
    throw err;
    ^

Error: Cannot find module 'minimatch'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/glob/glob.js:45:17)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

@AmitMY
Copy link
Contributor

AmitMY commented Jul 8, 2017

Great, so the issue can be closed?
btw, for future issues please follow the issue template

@QuestionPython
Copy link
Author

no not fixed , Error: Cannot find module 'minimatch' how can fix?

@AmitMY
Copy link
Contributor

AmitMY commented Jul 8, 2017

Try perhaps installing it manually if the initial npm install did not install it. npm install minimatch

@QuestionPython
Copy link
Author

[guest@guest ~]$ npm update minimatch@3.0.2
[guest@guest ~]$ 
[guest@guest ~]$ npm update -d
npm info it worked if it ends with ok
npm info using npm@4.6.1
npm info using node@v8.1.3
npm info attempt registry request try #1 at 10:40:18 PM
npm http request GET https://registry.npmjs.org/crx
npm info attempt registry request try #1 at 10:40:18 PM
npm http request GET https://registry.npmjs.org/sweetalert
npm info attempt registry request try #1 at 10:40:18 PM
npm http request GET https://registry.npmjs.org/npmlog
npm http 200 https://registry.npmjs.org/sweetalert
npm http 200 https://registry.npmjs.org/crx
npm http 200 https://registry.npmjs.org/npmlog
npm info ok 
[guest@guest ~]$ npm update -g minimatch@3.0.2
[guest@guest ~]$ npm update minimatch
[guest@guest ~]$ npm -v
4.6.1
[guest@guest ~]$ sudo npm install -g minimatch@3.0.2
[sudo] password for guest: 
/usr/lib
└─┬ minimatch@3.0.2 
  └─┬ brace-expansion@1.1.8 
    ├── balanced-match@1.0.0 
    └── concat-map@0.0.1 

Now

$ ionic start myApp tabs

module.js:487
    throw err;
    ^

Error: Cannot find module 'block-stream'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/tar/lib/entry-writer.js:7:19)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

@AmitMY
Copy link
Contributor

AmitMY commented Jul 8, 2017

Please run ionic info.
Also, it seems to not install block-stream, you can try to manually install that as well, but it is weird you need to install those.

@QuestionPython
Copy link
Author

$ ionic info

    throw err;
    ^

Error: Cannot find module 'block-stream'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/tar/lib/entry-writer.js:7:19)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)



$ ionic

module.js:487
    throw err;
    ^

Error: Cannot find module 'block-stream'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/tar/lib/entry-writer.js:7:19)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

@AmitMY
Copy link
Contributor

AmitMY commented Jul 8, 2017

Ok so it seems like ionic-cli is giving you trouble, not ionic.
Try npm i -g ionic@latest, and try again. If that does not work, please create an issue with ionic-cli

@QuestionPython
Copy link
Author

QuestionPython commented Jul 8, 2017

$ npm -v
5.1.0
$ node -v
v8.1.3
$ apm -v
(node:7669) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
apm  1.18.2
npm  5.1.0
node 8.1.3 x64
python 2.7.13
git 2.12.2

ok wait...

@QuestionPython
Copy link
Author

$ ionic-cli

bash: ionic-cli: command not found

$ sudo npm i -g ionic@latest

/usr/bin/ionic -> /usr/lib/node_modules/ionic/bin/ionic
+ ionic@3.4.0
updated 1 package in 24.621s

@QuestionPython
Copy link
Author

$ sudo npm install -g cordova ionic

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
/usr/bin/ionic -> /usr/lib/node_modules/ionic/bin/ionic
/usr/bin/cordova -> /usr/lib/node_modules/cordova/bin/cordova
+ cordova@7.0.1
+ ionic@3.4.0
updated 2 packages in 62.238s

@QuestionPython
Copy link
Author

$ ionic

module.js:487
    throw err;
    ^

Error: Cannot find module 'block-stream'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/tar/lib/entry-writer.js:7:19)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

@QuestionPython
Copy link
Author

$ sudo npm install -g ionic-cli

npm WARN deprecated ionic-cli@0.0.0: If you're looking for the Ionic CLI, install ionic, not ionic-cli
+ ionic-cli@0.0.0
added 1 package in 3.515s

@AmitMY
Copy link
Contributor

AmitMY commented Jul 8, 2017

Ok so it seems like you got some definitions mixed up, probably ionic's fault.
The ionic package, on github is ionic-cli.
The ionic-angular package is ionic on github.

So what I was saying is to install the ionic-cli by doing npm i -g ionic@latest, and if still doing ionic info fails, something is seriously wrong, and you should create an issue on the ionic-cli repo.

@wbhob
Copy link

wbhob commented Jul 9, 2017

To clarify @AmitMY's point, run these things:

npm uninstall -g ionic-cli
npm install -g ionic@latest

@jgw96
Copy link
Contributor

jgw96 commented Jul 14, 2017

Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!

@jgw96 jgw96 closed this as completed Jul 14, 2017
@QuestionPython
Copy link
Author

QuestionPython commented Jul 15, 2017

$ sudo npm install -g cordova ionic

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
/usr/bin/cordova -> /usr/lib/node_modules/cordova/bin/cordova
/usr/bin/ionic -> /usr/lib/node_modules/ionic/bin/ionic
+ cordova@7.0.1
+ ionic@3.5.0
added 6 packages, removed 6 packages and updated 15 packages in 91.819s


   ╭─────────────────────────────────────╮
   │                                     │
   │   Update available 4.6.1 → 5.3.0    │
   │     Run npm i -g npm to update      │
   │                                     │
   ╰─────────────────────────────────────╯

$ npm install -g ionic@latest

^Z.................] / rollbackFailedOptional: verb npm-session b58378fcb70e080a
[1]+  Stopped                 npm install -g ionic@latest

$ sudo npm uninstall -g ionic-cli
removed 1 package in 0.067s

$ sudo npm install -g ionic@latest
/usr/bin/ionic -> /usr/lib/node_modules/ionic/bin/ionic
+ ionic@3.5.0
updated 1 package in 18.046s

$ npm -v

5.3.0

@QuestionPython
Copy link
Author

QuestionPython commented Jul 15, 2017

$ cordova

Synopsis

    cordova command [options]

Global Commands
    create ............................. Create a project
    help ............................... Get help for a command
    telemetry .......................... Turn telemetry collection on or off
    config ............................. Set, get, delete, edit, and list global cordova options

Project Commands
    info ............................... Generate project information
    requirements ....................... Checks and print out all the requirements
                                            for platforms specified

    platform ........................... Manage project platforms
    plugin ............................. Manage project plugins

    prepare ............................ Copy files into platform(s) for building
    compile ............................ Build platform(s)
    clean .............................. Cleanup project from build artifacts

    run ................................ Run project
                                            (including prepare && compile)
    serve .............................. Run project with a local webserver
                                            (including prepare)

Learn more about command options using 'cordova help <command>'

Aliases
    build -> cordova prepare && cordova compile
    emulate -> cordova run --emulator

Options
    -v, --version ...................... prints out this utility's version
    -d, --verbose ...................... debug mode produces verbose log output for all activity,
    --no-update-notifier ............... disables check for CLI updates
    --nohooks .......................... suppress executing hooks
                                         (taking RegExp hook patterns as parameters)

Examples
    cordova create myApp org.apache.cordova.myApp myApp
    cordova plugin add cordova-plugin-camera
    cordova platform add android
    cordova plugin add cordova-plugin-camera --nosave
    cordova platform add android --nosave
    cordova requirements android    
    cordova build android --verbose
    cordova run android
    cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey
    cordova config ls
    cordova platform add ios --nofetch
    cordova plugin add cordova-plugin-camera --nofetch

$ ionic

module.js:487
    throw err;
    ^

Error: Cannot find module 'block-stream'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/tar/lib/entry-writer.js:7:19)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

my nodejs version have bug?

its say Error: Cannot find module 'block-stream' how can install this?

@wbhob
Copy link

wbhob commented Jul 15, 2017

try running rm -r node_modules; rm package-lock.json; npm install

@QuestionPython
Copy link
Author

QuestionPython commented Jul 15, 2017

$ rm -r node_modules; rm package-lock.json; npm install

rm: cannot remove 'node_modules': No such file or directory
rm: cannot remove 'package-lock.json': No such file or directory
npm WARN saveError ENOENT: no such file or directory, open '/home/guest/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/guest/package.json'
npm WARN guest No description
npm WARN guest No repository field.
npm WARN guest No README data
npm WARN guest No license field.

updated 17 packages in 4.815s

@wbhob
Copy link

wbhob commented Jul 15, 2017 via email

@QuestionPython
Copy link
Author

QuestionPython commented Jul 15, 2017

Tank You,i send here all output,log,error.
now what run?

@QuestionPython
Copy link
Author

$ ionic

module.js:487
    throw err;
    ^

Error: Cannot find module 'block-stream'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/tar/lib/entry-writer.js:7:19)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

i want fix this.
i think should install block-stream module on nodejs.

@QuestionPython
Copy link
Author

QuestionPython commented Jul 15, 2017

Wooow , Fixed

$ yaourt ionic

i try to install again nodejs-ionic.

$ ionic

  _             _     
 (_)           (_)     
  _  ___  _ __  _  ___ 
 | |/ _ \| '_ \| |/ __|
 | | (_) | | | | | (__ 
 |_|\___/|_| |_|_|\___|  CLI v1.7.16

Usage: ionic task args

=======================

Available tasks: (use --help or -h for more info)

   start  ..........  Starts a new Ionic project in the specified PATH
   serve  ..........  Start a local development server for app dev/testing
   platform  .......  Add platform target for building an Ionic app
   run  ............  Run an Ionic project on a connected device
   emulate  ........  Emulate an Ionic project on a simulator or emulator
   build  ..........  Locally build an Ionic project for a given platform
   plugin  .........  Add a Cordova plugin
   resources  ......  Automatically create icon and splash screen resources (beta)
		      Put your images in the ./resources directory, named splash or icon.
		      Accepted file types are .png, .ai, and .psd.
		      Icons should be 192x192 px without rounded corners.
		      Splashscreens should be 2208x2208 px, with the image centered in the middle.

   upload  .........  Upload an app to your Ionic account
   share  ..........  Share an app with a client, co-worker, friend, or customer
   lib  ............  Gets Ionic library version or updates the Ionic library
   setup  ..........  Configure the project with a build tool (beta)
   io  .............  Integrate your app with the ionic.io platform services (alpha)
   security  .......  Store your app's credentials for the Ionic Platform (alpha)
   push  ...........  Upload APNS and GCM credentials to Ionic Push (alpha)
   package  ........  Use Ionic Package to build your app (alpha)
   config  .........  Set configuration variables for your ionic app (alpha)
   browser  ........  Add another browser for a platform (beta)
   service  ........  Add an Ionic service package and install any required plugins
   add  ............  Add an Ion, bower component, or addon to the project
   remove  .........  Remove an Ion, bower component, or addon from the project
   list  ...........  List Ions, bower components, or addons in the project
   info  ...........  List information about the users runtime environment
   help  ...........  Provides help for a certain command
   link  ...........  Sets your Ionic App ID for your project
   hooks  ..........  Manage your Ionic Cordova hooks
   state  ..........  Saves or restores state of your Ionic Application using the package.json file
   docs  ...........  Opens up the documentation for Ionic


------------------------------------
Ionic CLI is out of date:
 * Locally installed version: 1.7.16
 * Latest version: 3.5.0
 * https://github.com/driftyco/ionic-cli/blob/master/CHANGELOG.md
 * Run npm install -g ionic to update
------------------------------------

woow Work. 👍

now i am try sudo npm install -g ionic....

wait..

@QuestionPython
Copy link
Author

QuestionPython commented Jul 15, 2017

$ sudo npm install -g ionic

/usr/bin/ionic -> /usr/lib/node_modules/ionic/bin/ionic
+ ionic@3.5.0
removed 1511 packages and updated 11 packages in 94.706s

$ ionic

module.js:487
    throw err;
    ^

Error: Cannot find module 'block-stream'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/tar/lib/entry-writer.js:7:19)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

Why after update , this not work!

mean new version not match with my system? have bug?!

@QuestionPython
Copy link
Author

i again try install nodejs-ionic:

$ ionic

  _             _     
 (_)           (_)     
  _  ___  _ __  _  ___ 
 | |/ _ \| '_ \| |/ __|
 | | (_) | | | | | (__ 
 |_|\___/|_| |_|_|\___|  CLI v1.7.16

Usage: ionic task args

=======================

Available tasks: (use --help or -h for more info)

   start  ..........  Starts a new Ionic project in the specified PATH
   serve  ..........  Start a local development server for app dev/testing
   platform  .......  Add platform target for building an Ionic app
   run  ............  Run an Ionic project on a connected device
   emulate  ........  Emulate an Ionic project on a simulator or emulator
   build  ..........  Locally build an Ionic project for a given platform
   plugin  .........  Add a Cordova plugin
   resources  ......  Automatically create icon and splash screen resources (beta)
		      Put your images in the ./resources directory, named splash or icon.
		      Accepted file types are .png, .ai, and .psd.
		      Icons should be 192x192 px without rounded corners.
		      Splashscreens should be 2208x2208 px, with the image centered in the middle.

   upload  .........  Upload an app to your Ionic account
   share  ..........  Share an app with a client, co-worker, friend, or customer
   lib  ............  Gets Ionic library version or updates the Ionic library
   setup  ..........  Configure the project with a build tool (beta)
   io  .............  Integrate your app with the ionic.io platform services (alpha)
   security  .......  Store your app's credentials for the Ionic Platform (alpha)
   push  ...........  Upload APNS and GCM credentials to Ionic Push (alpha)
   package  ........  Use Ionic Package to build your app (alpha)
   config  .........  Set configuration variables for your ionic app (alpha)
   browser  ........  Add another browser for a platform (beta)
   service  ........  Add an Ionic service package and install any required plugins
   add  ............  Add an Ion, bower component, or addon to the project
   remove  .........  Remove an Ion, bower component, or addon from the project
   list  ...........  List Ions, bower components, or addons in the project
   info  ...........  List information about the users runtime environment
   help  ...........  Provides help for a certain command
   link  ...........  Sets your Ionic App ID for your project
   hooks  ..........  Manage your Ionic Cordova hooks
   state  ..........  Saves or restores state of your Ionic Application using the package.json file
   docs  ...........  Opens up the documentation for Ionic

@QuestionPython
Copy link
Author

why not show message for update?
current version is v1.7.16. not need update?

@QuestionPython
Copy link
Author

QuestionPython commented Jul 15, 2017

$ apm -v

(node:16084) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
apm  1.18.2
npm  4.6.1
node 8.1.3 x64
python 2.7.13
git 2.12.2

$ ionic start MyApp tabs

Error: Cannot find module 'internal/fs'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at evalmachine.<anonymous>:40:20
    at Object.<anonymous> (/usr/lib/node_modules/ionic/node_modules/unzip/node_modules/fstream/node_modules/graceful-fs/fs.js:11:1)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)

Cannot find module 'internal/fs' (CLI v1.7.16)

Your system information:

Cordova CLI: 7.0.1
Gulp version:  CLI version 3.9.1
Gulp local:  
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
OS: Distributor ID:	Arch Description:	Arch Linux 
Node Version: v8.1.3

@QuestionPython
Copy link
Author

QuestionPython commented Jul 15, 2017

nodejs/node#13361

i uninstall node 8 , and reinstall node 6 (https://nodejs.org/dist/v6.11.1/node-v6.11.1-linux-x64.tar.xz) and copy all files,dirs of them to /usr/.

so now:

$ node -v

v6.11.1

$ ionic start MyApp tabs

 ✗ (node:17767) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Creating Ionic app in folder /home/max/Projects/ionic/MyApp based on tabs project
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
[=============================]  100%  0.0s
Downloading: https://github.com/driftyco/ionic-starter-tabs/archive/master.zip
[=============================]  100%  0.0s
Updated the hooks directory to have execute permissions
Update Config.xml
Initializing cordova project

wait...

@QuestionPython
Copy link
Author

QuestionPython commented Jul 15, 2017

Update Config.xml
Initializing cordova project
shell.js: internal error
Error: ENOSPC: no space left on device, write
    at Error (native)
    at Object.fs.writeSync (fs.js:787:20)
    at Object.fs.writeFileSync (fs.js:1357:24)
    at execSync (/usr/lib/node_modules/ionic/node_modules/shelljs/src/exec.js:67:57)
    at Object._exec (/usr/lib/node_modules/ionic/node_modules/shelljs/src/exec.js:179:12)
    at Object.exec (/usr/lib/node_modules/ionic/node_modules/shelljs/src/common.js:168:23)
    at Object.getLinuxEnvironmentInfo (/usr/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/info.js:167:24)
    at Object.getOsEnvironment (/usr/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/info.js:184:22)
    at Object.gatherInfo (/usr/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/info.js:239:8)
    at Object.gatherInfo (/usr/lib/node_modules/ionic/lib/cli.js:493:19)

what mean this?
mean have error or no?

@AmitMY
Copy link
Contributor

AmitMY commented Jul 15, 2017

Your errors are pretty weird.. I think you can get better help in the forum, as I don't know how to help for this

@wbhob
Copy link

wbhob commented Jul 15, 2017

It means your computer is out of storage. Clear up some space, at least 5 GB to be safe

@wbhob
Copy link

wbhob commented Jul 15, 2017

The ionic cli is not 'nodejs-ionic' it is just 'ionic'

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 2, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants