Cannot find module 'read' when using ionic start - node.js

Trying to get started with ionic and am not able start an app.
When I try ionic start myApp blank it gives the above error, cannot find module 'read'.
aarmora#Breeze:/home/sites$ ionic start taskApp blank
Error: Cannot find module 'read'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/prompt/lib/prompt.js:12:12)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
Cannot find module 'read' (CLI v1.7.14)
Your system information:
Cordova CLI: Not installed
Gulp version: CLI version 3.9.0
Gulp local:
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS
Node Version: v4.3.0
When I try to install this package, it looks like it's already installed.
aarmora#Breeze:/home/sites$ sudo npm install -g read
read#1.0.7 /usr/lib/node_modules/read
└── mute-stream#0.0.5
I've uninstalled node, cordova, ionic and reinstalled all of them but it yields the same.
Any ideas?

This is clearly a problem with the installation of ionic. Since you've stated that you've already tried to reinstall ionic and it didn't work, here are two options:
1) Reinstallation with a clean cache
npm cache clean
npm uninstall ionic -g
npm install ionic -g
2) If the previous one didn't work, let's get a little more hacky
cd /usr/local/lib/node_modules/ionic
npm install read
For both options, according to your machine config, you might have to sudo.

Related

Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' Require stack:

I have webpack-cli installed on my laravel project. I don't know why first of all we need it to run my vue app but this is causing an error:
When I run npm run dev or npm run hot
[webpack-cli] Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin'
Require stack:
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\plugin-webpack5.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\plugin.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\index.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\src\components\Vue.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\src\components\ComponentRegistrar.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\src\Mix.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\setup\webpack.config.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack-cli\lib\webpack-cli.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack-cli\lib\bootstrap.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack-cli\bin\cli.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack\bin\webpack.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\plugin-webpack5.js:6:42)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\vue-loader\\lib\\plugin-webpack5.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\vue-loader\\lib\\plugin.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\vue-loader\\lib\\index.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\laravel-mix\\src\\components\\Vue.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\laravel-mix\\src\\components\\ComponentRegistrar.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\laravel-mix\\src\\Mix.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\laravel-mix\\setup\\webpack.config.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\webpack-cli\\lib\\webpack-cli.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\webpack-cli\\lib\\bootstrap.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\webpack-cli\\bin\\cli.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\webpack\\bin\\webpack.js'
]
}
Vue is installed also vue-loader, can't understand why it can't find those files. Also, I looked at the node_modules everything is in there ...
You need to update your vue-loader
npm update vue-loader
And if it is not installed, install it
npm i vue-loader
Laravel added the 15.9.7 version of Vue-loader by default. I have to manually update the vue-loader:^15.9.8 in the package JSON to solve the error.
Then do yarn and yarn dev or npm install and npm run dev
I had this error in my project. After searching for it, I discovered that I have to upgrade the Vue loader. And if not installed, go ahead and install it from here. So I add this line to my terminal in my project.
npm install -D vue-loader vue-template-compiler
running
npm update vue-loader
should do the work just fine if the vue-loader package is already installed.
Some of those updates are major releases. Running npm update won’t update the version of those. Major releases are never updated in this way because they (by definition) introduce breaking changes, and npm want to save you trouble.
Some times npm packages not gets installed properly, i used following method to resolve this problem:
**
Delete node modules folder from your project.
Execute following commands
npm install -g npm-check-updates
ncu -u
npm install/update.**

Error: Cannot find module 'commander'

when I m running sails -v, sails lift or even installing npm I m getting this error Please help -
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/sails/bin/_commander.js:6:15)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
Most likely commander is missing from package.json. Install it and add it to package.json by doing:
npm install commander --save
Install commander globally.
sudo npm install commander -g
This will install commander module under/usr/lib/node_modules/.
Uninstalling sails and reinstalling with 'sudo' resolved it.
npm uninstall sails -g
sudo npm install sails -g
When i try setup new app with the help of express-generator.
given error:Cannot find module 'commander'
Node version:12.16.1
switch node version :10.16.3
after switch node version is working fine..
In my case it was because of bad version of node. I've tried node 8.15.1 and it works.
On my end, after doing npm install, and attempt to run npm run watch I encountered this same issue of Error: Cannot find module 'commander'.
I did below:
// delete node_modules (can do manually) or command below
// rm -rf node_modules
npm install
And I was able to do npm run watch again.
This maybe because of corrupted packages.

Unable to run basic ionic template : Error: Cannot find module 'fast-deep-equal'

I'm new to ionic and I install the basic blank template as below.
First installed ionic and Cordova using the command
npm install -g ionic Cordova.
once done created my own first ionic using command
ionic start myApp1 blank
next cd into the myApp1 directory and tried to run the application using the command .
ionic serve
but I get below error
ionic serve
Error: Cannot find module 'fast-deep-equal'
at Function.Module._resolveFilename (module.js:513:15)
at Function.Module._load (module.js:463:25)
at Module.require (module.js:556:17)
at require (internal/module.js:11:18)
at Object.<anonymous>
(D:\Proj\myApp1\node_modules\ajv\lib\compile\resolve.js:4:13)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
at Function.Module._load (module.js:486:3)
I tried to remove the node_modules folder, delete the package-lock.json and install again using the command npm install but still same issue.
Ionic version is 3.19.1 and node version is 5.4.2
Please help me to resolve issue.
This error says that your project cant find module 'fast-deep-equal' so you have to install it:
cd into your project and just do:
npm install fast-deep-equal
if that gives you error, you can delete all content inside node_modules.bin\ and repeat that command.
Hope that helps you to fix that issue, it helped me.

npm Error “ Cannot find module 'npmlog' ”

I am running CentOS 6 and after logging in, I encounter the following error
module.js:340
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /home/dspace/.nvm/v0.10.31/bin/npm:19:11
at Object.<anonymous> (/home/dspace/.nvm/v0.10.31/bin/npm:87:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `npm config delete prefix` or `nvm use --delete-prefix v0.10.31 --silent` to unset it.
I've discovered that it is a version bug and can be resolved either by upgrading the npm version or by deleting the node modules like so;
rm -rf node_modules
Then reinstalling them;
npm install
After removing the modules, npm install failed to run because of missing dependancies i.e. the modules. Now the command shows no response at all.
My node version is v0.10.48
This worked for me
Install nvm:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
Restart the terminal
Run
nvm install node
 
I had the same problem after proposed npm upgrade via npm -i -g npm. But Fedora npm/node installed via dnf has modules links to /usr/lib/node_modules/npm/node_modules.bundled/ from /usr/lib/node_modules/npm/node_modules/. I saw links were broken because usr/lib/node_modules/npm/node_modules.bundled/ disappeared. So reinstallation node,nodejs,npm via dnf/rpm solved the problem.

angular cli not working on windows 10

I have just reinstall node.js, npm and angular-cli but this last one does not work on my PC running on Windows 10. The version of node.js is 8.1.2, the version of npm is 5.0.3. I installed angular-cli with the command line npm install -g #angular/cli. Now when I try any command line beginning with ng I have the error:
module.js:487
throw err;
^
Error: Cannot find module '#ngtools/json-schema'
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> (C:\Users\Raphaël\AppData\Roaming\npm\node_modules\#angular\cli\models\config\config.js:6:23)
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)
Any idea what is wrong?
Shot in the dark, but I heard of -g installs interfering with local angular cli. However, this appears to just be a missing module from the download, maybe just a package lost. Try to uninstall and re-install again
I'm also on Windows 10. Node 8.1.4 and npm 5.2.0
What worked for me was following the steps from an issue thread I found on github: https://github.com/angular/angular-cli/issues/4425
. The link describes the following steps:
Uninstall angular cli
npm uninstall #angular/cli -g
Install rxJS
npm install rxjs -g
Cleared cache
npm cache clean
Manually deleted content in
%AppData%\npm\node_modules
Installed angular cli npm install
#angular/cli -g
Try downgrading node to v7 and npm to v4 then run:
rm -rf node_modules dist
npm cache clear --force
npm install
There are also some threads mentioning the removal of package.lock which is a new part of npm#5. Furhtermore it is worth checking you typescript version ensuring it is > 2.2.0.

Resources