I’ve been trying for three solid days to create a new ionic project. I have tons of npm cruft on my computer and I think that’s what’s causing these problems.
node v6.11.2
npm 5.3.0
ionic 3.8.1
here’s what I get when I run sudo ionic start tmp1 tabs
✔ Creating directory ./tmp1 - done!
[INFO] Fetching app base (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)
✔ Downloading - done!
[INFO] Fetching starter template tabs (https://github.com/ionic-team/ionic2-starter-tabs/archive/master.tar.gz)
✔ Downloading - done!
✔ Updating package.json with app details - done!
✔ Creating configuration file ionic.config.json - done!
[INFO] Installing dependencies may take several minutes!
✖ npm install - failed!
[ERROR] An error occurred while running npm install (exit code 1):
npm WARN deprecated babili@0.1.2: babili has been renamed to babel-minify. Please update to babel-minify
npm WARN deprecated babel-preset-babili@0.1.4: babili has been renamed to babel-minify. Please update to
babel-preset-minify
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys
> fsevents@1.1.2 install /Users/alesh/Sites/Javascript/Javascript Projects/tmp1/node_modules/fsevents
> node install
sh: node: command not found
> node-sass@4.5.3 install /Users/alesh/Sites/Javascript/Javascript Projects/tmp1/node_modules/node-sass
> node scripts/install.js
sh: node: command not found
npm WARN ajv-keywords@2.1.0 requires a peer of ajv@>=5.0.0 but none was installed.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn ENOENT
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! node-sass@4.5.3 install: `node scripts/install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the node-sass@4.5.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alesh/.npm/_logs/2017-08-15T11_45_31_247Z-debug.log
What I would honestly like to do is to destroy all my global npm packages and configuration and start completely from scratch. Doable without literally re-installing the OS? (When I run npm ls -g --depth-0 i get 2554 lines of output.)
Definitely not. You should uninstall all globally installed node/npm stuff, install nvm, and use that to manage your node installations, which will all be under your home directory.
That was sort of my original question–do I have to go one by one? I’ve got hundreds of packages installed locally. (When I run npm ls -g --depth-0 i get 2554 lines of output.)
I’ve used nvm ever since I started using node, so I don’t have any direct experience with how distros package it. This looks like it may be helpful, and if you’ve installed any node/npm stuff with your package manager (such as apt-get or yum), I would uninstall via that package manager as well.
The cheap’n’easy answer is: install nvm and a new version of Node, and treat it like a partition of your disk. You don’t have to uninstall any of the old stuff. Just don’t allow it to affect your new install. Downside: lots of crap taking up disk space. Upside: you don’t have to do any work.