I am getting the following error when installing iconic. I have tried quite a few different things but can’t crack why this install is failing. Would really appreciate any tips. This is on MacOS 10.10.5 Yosemite
sudo npm install -g ionic
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
npm WARN deprecated node-uuid@1.3.3: use uuid module instead
/usr/local/lib
└── (empty)
npm WARN In ionic@2.2.1 replacing bundled version of cross-spawn with cross-spawn@4.0.2
npm WARN In ionic@2.2.1 replacing bundled version of mime-types with mime-types@2.0.14
npm WARN In ionic@2.2.1 replacing bundled version of semver with semver@4.2.0
npm WARN In ionic@2.2.1 replacing bundled version of form-data with form-data@0.2.0
npm WARN In ionic@2.2.1 replacing bundled version of request with request@2.51.0
npm WARN In ionic@2.2.1 replacing bundled version of ionic-app-lib with ionic-app-lib@2.2.0
npm ERR! Darwin 14.5.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” "ionic"
npm ERR! node v6.10.0
npm ERR! npm v4.3.0
npm ERR! path /usr/local/lib/node_modules/.staging/ansi-392b32ed
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/.staging/ansi-392b32ed’ -> '/usr/local/lib/node_modules/ionic/node_modules/cordova-lib/node_modules/ansi’
npm ERR! enoent ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/.staging/ansi-392b32ed’ -> '/usr/local/lib/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! /Users/macuser/.npm/_logs/2017-02-28T12_07_22_388Z-debug.log
The install is failing because you are missing this folder. Seems like npm thinks that module is already in your .staging folder but it’s not. These types of errors are super common, sometimes npm messes up it’s cache. A quick google of: “npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging” lead to a bunch of results, one of which will most likely fix your issue.
Yet another plug for nvm. There is no need to ever run npm as root. It’s irresponsible from a security perspective and greatly complicates cleaning things up.
I installed ionic successfully. But Got this Error.
Macs-MacBook-Pro-2:~ huyle$ sudo npm install -g ionic
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0