Not sure what happened but my Node + NPM are just mucked up completely. I've tried uninstalling everything node/npm related - reinstalling using NVM. Install works great -
➜ ~ npm -v
5.3.0
➜ ~ node -v
v8.2.1
But I keep getting errors absolutely everywhere - no matter what project/package I'm in.
For example - I'm trying to install Hexo (static site generator) with this command -
npm install hexo-cli -g
Install works fine, but the 'hexo' command gives me -
➜ ~ hexo
zsh: command not found: hexo
Alright, this isn't terrible - let's try another project. Here I cloned the following Node project https://github.com/EmailThis/extension-boilerplate into a folder called 'learnio'
npm install works okay -
➜ learnio git:(master) ✗ npm install
npm WARN extension-boilerplate@0.0.2 No license field.
up to date in 4.289s
But npm run build gives me -
➜ learnio git:(master) ✗ npm run build
> extension-boilerplate@0.0.2 build /home/patrick/Programming/learnio
> cross-env NODE_ENV=production npm run chrome-build && cross-env NODE_ENV=production npm run opera-build && cross-env NODE_ENV=production npm run firefox-build
sh: 1: cross-env: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! extension-boilerplate@0.0.2 build: `cross-env NODE_ENV=production npm run chrome-build && cross-env NODE_ENV=production npm run opera-build && cross-env NODE_ENV=production npm run firefox-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the extension-boilerplate@0.0.2 build 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! /home/patrick/.npm/_logs/2017-07-31T03_59_53_074Z-debug.log
I've tried to install cross-env manually, but no go.
These are just a few of the problems I'm having. Is this a permissions issue? I've tried chowning as many npm/node folders as possible, nothing is working.
Usually in this case I'd just reinstall my OS (Debian) but I'm travelling at the moment and don't have the time luxury to do that sadly.
Any help would be appreciated, thanks so much.