Ionic-cli: after trying to update ionic lodash/assign not found

Created on 22 Sep 2016  Â·  7Comments  Â·  Source: ionic-team/ionic-cli

$ ionic
Caught exception:
Error: Cannot find module 'lodash/assign'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/usr/lib/node_modules/ionic/node_modules/xmlbuilder/lib/index.js:5:12)
at Object. (/usr/lib/node_modules/ionic/node_modules/xmlbuilder/lib/index.js:14:4)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

old major version

Most helpful comment

I have solved the problem just re-installing the package

npm remove -g ionic
npm install -g ionic

All 7 comments

Could you provide me with the output from ionic info from within your project directory? Thanks, this should help in troubleshooting.

Thanks but you can close this. Problem was probably a lower version of
lodash which I needed for another app. Wish that ionic-cli could just be a
self contained app. There are too many apps requiring too many different
version of node packages. Wonder if something like nar (
https://github.com/h2non/nar) could help

On Tue, Sep 27, 2016 at 12:35 PM, Josh Thomas [email protected]
wrote:

Could you provide me with the output from ionic info from within your
project directory? Thanks, this should help in troubleshooting.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/driftyco/ionic-cli/issues/1402#issuecomment-249973682,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB9aGLYmy8JsgPcPeauUGuST0olA3monks5quW_4gaJpZM4KETjb
.

Which version of Lodash should you be using? Some sub modules are complaining for me. And I still have this issue after getting the latest

I have solved the problem just re-installing the package

npm remove -g ionic
npm install -g ionic

Can't fix this problem by reinstalling. Cannot provide ionic info because every ionic command fails:

$ ionic info
Caught exception:
 Error: Cannot find module 'lodash/assign'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/xmlbuilder/lib/index.js:5:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/xmlbuilder/lib/index.js:14:4)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues
$ node -v
v7.3.0
$ npm -v
3.9.6

My depencies:

"dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/compiler-cli": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/platform-server": "2.2.1",
    "@ionic/storage": "1.1.6",
    "@types/ng-cordova": "0.0.11",
    "async": "^2.1.4",
    "color": "^1.0.3",
    "crypto-js": "^3.1.6",
    "ionic-angular": "2.0.0-rc.4",
    "ionic-native": "2.2.11",
    "ionicons": "3.0.0",
    "leveldown": "^1.5.3",
    "lodash": "^4.15.0",
    "ng2-pdf-viewer": "^0.1.5",
    "ng2-translate": "^4.2.0",
    "pouchdb": "^6.1.0",
    "rxjs": "5.0.0-beta.12",
    "store.pouchdb": "git+https://github.com/heikoholland/store.pouchdb.git",
    "zone.js": "0.6.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.47",
    "typescript": "2.0.9"
  },
$ npm ls -g -depth=0
~/.nvm/versions/node/v7.3.0/lib
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

Alright. I fixed it. I messed up my environment with an old installation of node not using nvm. After removing all node modules in /usr/local/lib/node_modules/ and only using the node version of my nvm installed node versions everything is good again.

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings