1

I am having a lot of trouble using npm. Almost at each install I get issues

npm ERR! Maximum call stack size exceeded

or

npm ERR! syscall spawn
npm ERR! foobar@1.0.0 lint: `eslint --ext .js,.vue src test/unit test/e2e/specs "--fix"`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the foobar@1.0.0 lint script.

or

$ sudo npm install -g hpack.js
npm ERR! path /usr/lib/node_modules/.staging/hpack.js-6a009775
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rename
npm ERR! Error: EACCES: permission denied, 

or

npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/lib/node_modules/vue-cli/node_modules/download-git-repo' -> '/usr/lib/node_modules/vue-cli/node_modules/.download-git-repo.DELETE'

or

$ npm run dev

> foobar@1.0.0 dev /home/ycr/my-project
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

sh: 1: webpack-dev-server: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE

Often I can solve the problem by uninstalling and reinstalling the package or simply manually installing the missing dependencies, but it is painful.

sudo npm uninstall -g vue-cli
sudo npm install -g vue-cli

But it looks very unstable and I don't understand why I get all these issues.

$ node -v
v8.10.0
$ npm -v
5.7.1
$ uname -a
Linux CE589UT 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux

My goal is to be able to install packages such as Angular, vue.js, node-red, ... to test them. Until now each time I have to use npm I get errors.

Any clues or ideas to troubleshot these instabilities?

nowox
  • 25,978
  • 39
  • 143
  • 293

1 Answers1

1

It looks like all the npm-errors were redirected to your instance :) which I had faced earlier. It's good to clean your hands on these general errors which make your npm handling skills more clear and sharpen.

From the error logs you provided, these type of issue only occurs due to cache junk, broken node installation or permission access to perform npm operations.

The global solution I would suggest you, to overcome all these issues. use NVM to work around node and npm. NVM stands for node version manager which itself handles all the required node-path structure, permissions to respective directories, and all the node and npm versions compatibility. Below is the link to install NVM on your system.

https://www.liquidweb.com/kb/how-to-install-node-js-via-nvm-node-version-manager-on-ubuntu-14-04-lts/

Before using NVM i will recommend you to uninstall/remove node and npm completely from your system. to do this you can refer below links:

https://hungred.com/how-to/completely-removing-nodejs-npm/

Completly uninstall nodejs, npm and node in ubuntu 14.04

Hope this will help you!

Suhas Gavad
  • 1,199
  • 1
  • 8
  • 12