ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

cannot find module inherits

Open Samoht1 opened this issue 10 years ago • 7 comments

I tried updating my Ionic Library using ionic update lib, but then it gave me some error which I can't remember. Then I tried running npm install -g ionic but then i got loads of errors:

npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0. npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0. npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls gr aceful-fs' to find it in the tree. C:\Users\lilopel-06\AppData\Roaming\npm `-- (empty)

npm WARN In [email protected] replacing bundled version of semver with [email protected] npm WARN In [email protected] replacing bundled version of ionic-app-lib with [email protected] npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\lilopel-06\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "ionic" "-g" npm ERR! node v4.5.0 npm ERR! npm v3.10.8 npm ERR! path C:\Users\lilopel-06\AppData\Roaming\npm\node_modules.staging\ansi-89bf214f npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\lilopel-06\AppData\Roaming\npm\node_modules.staging\ansi-89bf214f' -> 'C:\Users\lilopel-06\AppData\Roaming
npm\node_modules\ionic\node_modules\cordova-lib\node_modules\ansi' npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\lilopel-06\AppData\Roaming\npm\node_modules.staging\ansi-89bf214f' -> 'C:\Users\lilopel-06\AppData\Roaming
npm\node_modules\ionic\node_modules\cordova-lib\node_modules\ansi' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\lilopel-06\OneDrive\myApp\npm-debug.log

npm ERR! code 1

and now im getting this: cannot find module inherits; everytime I try to use Ionic in my project

Samoht1 avatar Sep 29 '16 10:09 Samoht1

I have the same issue...

Macstyg avatar Sep 29 '16 10:09 Macstyg

i have the same issue kindly suggest stable version

bazigatabassum avatar Sep 29 '16 10:09 bazigatabassum

So I just went f*ck it and uninstalled everything, reinstalled everything and it was done without errors, and my app works again. Node.js 4.6 has been released a few days ago so try reinstalling node.js first

Samoht1 avatar Sep 29 '16 11:09 Samoht1

@sabre96 good call. First thing I would do is check the version of NodeJS and NPM. With the release of 2.1.0 the package.json is using a scoped package which only works with NPM 2.7+.

https://docs.npmjs.com/getting-started/scoped-packages

jthoms1 avatar Sep 29 '16 14:09 jthoms1

Try running the following commands to get the latest.

npm uninstall -g ionic
npm install -g [email protected]

Please let me know if this works for you.

jthoms1 avatar Sep 30 '16 15:09 jthoms1

For me the solution was to install latest version of NodeJs, and npm (Node v.6.7.0, npm v.3.10.0). Previously I had Node v.5.7.0, npm v.3.6.0

Macstyg avatar Sep 30 '16 16:09 Macstyg

Hello all! As Josh mentioned above the solution to this issue is to install the latest version of npm. If you install Node 6 you will get the latest version of npm by default, but if you are on Node 4 you can update to npm 3 by running npm install -g npm. Thanks! Also, just a friendly reminder, Node 6 becomes the LTS release of Node this month, so updating to the latest Node 6 release is probably your best bet.

jgw96 avatar Oct 12 '16 01:10 jgw96