npm install installs, but node_modules is empty - node.js

I have a VM on digital ocean running Ubuntu 16.04. I installed node and git. I am pulling my repo, and trying to install all dependencies.
I run npm install inside my project folder. Everything looks to install correctly. Then I try to start my app by running node server.js and I get all sorts of module not found errors.
When I look inside node_modules, the directory is empty.
Any ideas what might be happening?
Output:
root#codetrunk-dev:~/codetrunk# npm install --save
npm WARN deprecated swig#1.4.2: This package is no longer maintained
npm WARN deprecated lodash.isarray#4.0.0: This package is deprecated. Use Array.isArray.
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 minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash#1.0.2: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^4.0.0.
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs#2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
Killed ...] / extract:alt: verb gentlyRm don't care about contents; nuking /root/codetrunk/node_modules/.staging/alt-983484ae/node
root#codetrunk-dev:~/codetrunk# ls
app bower.json config.js gulpfile.js models node_modules package.json public server.js views
root#codetrunk-dev:~/codetrunk# cd node_modules/
root#codetrunk-dev:~/codetrunk/node_modules# ls
root#codetrunk-dev:~/codetrunk/node_modules# ls
root#codetrunk-dev:~/codetrunk/node_modules#

You have to increase memory of your droplet from 512mb to 1gb, at least to install the npm modules. Then you can go back to 512mb if you want. That fixed it for me.

It might be that your package.json file either does not exist or has no dependenciesor devDependencies.

Another option that doesn't require increasing the memory of your droplet (or, if you're not on a server that has that ability) is to manually install dependencies individually or in small groups. In my case, express was the biggest package I was installing, so I installed that manually with npm install express, then ran npm install to get the rest.

Related

Can't install Gulp on node 8.12.0

When I try the sudo npm install --save-dev gulp command, it returns this error:
npm WARN deprecated gulp-util#3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated graceful-fs#3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
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 minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN gus#1.0.0 No description
npm WARN gus#1.0.0 No repository field.
I've reinstalled gulp (multiple times) and node (& npm) and it still won't work.
What do I do?
(I'm using macOS 10.13.6 and I installed node via homebrew)
Why are you trying to install with --save-dev?
Installing Gulp globally should be done with --global
Have you checked their installation guide?
https://gulpjs.org/getting-started.html

npm start not working and gulp is deprecate?

First post here. Sorry its so long.
I am trying to contribute towards an open source project on Github. I successfully downloaded and cloned the project. I am using Windows 10 and Node.js version v8.11.2
When I run npm start in my command prompt I get the following error:
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ashley Clarke\AppData\Roaming\npm-cache\_logs\2018-06-06T18_34_45_556Z-debug.log
So I tried to make sure was connected to the gulp server in my Node.js command prompt.
And got this error:
C:\Users\Ashley Clarke>gulp server
[10:59:43] Local gulp not found in ~
[10:59:43] Try running: npm install gulp
Then when I ran npm install gulp this popped up.
C:\Users\Ashley Clarke>npm install gulp -g
npm WARN deprecated gulp-util#3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated graceful-fs#3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
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 minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
C:\Users\Ashley Clarke\AppData\Roaming\npm\gulp -> C:\Users\Ashley Clarke\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
+ gulp#3.9.1
added 255 packages in 45.834s
I tried to go to https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 but it talked about plugins. I guess I'm struggling with understanding what I need to do to connect to the gulp server so I can contribute to this open source project. Thanks!!
P.S tried to add pictures. Thanks in advance.

error while doing npm install

I am trying to do 'npm install' inside one of my folders but i am getting error code E403 Forbidden :
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
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 minimatch#0.2.14: Please update to minimatch 3.0.2 or higher
to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail
on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as
possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0
(node_modules\chokidar\node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 403 Forbidden:
https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz
npm ERR! code E403
npm ERR! 403 Forbidden: binary-extensions#^1.0.0
My npm version is 5.5.1
My node version is v8.9.1
Also my system was formatted today and I had to re-install and re-setup everything from scratch. npm install was working till yesterday before my system was formatted.
I have attached the log file here.
https://github.com/angular/angular-cli/files/1499291/2017-11-23T13_25_27_656Z-debug.log
Thanks in advance
EDIT: every npm install is failing.
for reference here are the entries in my .npmrc file:
registry=http://registry.npmjs.org/
proxy=http://user_name:password#proxy:port
https-proxy=http://user_name:password#proxy:port
strict-ssl=false
I have tried many commands to get this working but no luck.
Note: my password contains '#' symbol but i have encoded it in my .npmrc file as %40
Ok, so i got around this particular problem. Seems like i had to update http to https in registry, and E403 was gone. But still i was facing other issues so decided to downgrade npm to 3.10.10 and node to 6.10.3.
From the first line it's saying old node-uuid module is deprecated and won't be maintained moving forward. Try reinstalling using these commands.
npm uninstall --save node-uuid
npm install --save uuid
In the second line it's asking for installation of minimatch
So try running the command :
npm install -g minimatch#3.0.4

unable to install node 8 dependencies on ubuntu 16.4

I'm unable to install my project (that works very well under node 6). This is due to a dependency of node 8, that in addition to be deprecated also attempts to write somewhere where it doesn't have permissions.
ubuntu#ip-xxxxxxx:~/share_place/bin$ sudo npm i
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
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#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated jade#0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated to-iso-string#0.0.2: to-iso-string has been deprecated, use #segment/to-iso-string instead.
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 graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b v0.5.5 git://github.com/bookchin/node-ntp-client.git /home/ubuntu/.npm/_cacache/tmp/git-clone-cd074428
npm ERR! /home/ubuntu/.npm/_cacache/tmp/git-clone-cd074428/.git: Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-06-15T13_45_37_010Z-debug.log
ubuntu#ip-xxxxx:~/share_place/bin$ node -v
v8.1.2
It's very frustrating for us, since we're developing under windows and mac without issues, but now we're stuck at the preproduction.
Any help would be very welcome, thanks
If npm is running as root (because of sudo), it will drop root privileges right before executing external scripts/programs (like git). By default it will setuid to nobody.
This causes permission issues because nobody is most likely not allowed to write to the directory /home/ubuntu/.npm/_cacache/tmp/git-clone-cd074428/ (hence the "Permission denied" error).
The best solution is to not use sudo at all. In your case, installing only local dependencies, it makes even less sense than the usual situation, where sudo is used to install something globally (-g).
Perhaps you may have to clean up the permissions in /home/ubuntu/.npm/ too, if some files/directories in there now belong to root:
sudo chown -R $USER /home/ubuntu/.npm

Install ember#1.13.13 on Windows 7 and it keeps hanging on the extract of bower

I'm trying to "npm install -g ember#1.13.13" on Windows 7 and it keeps hanging on the extract of bower. I've tried clearing the npm cache and the bower cache but it still hangs. I'm installing that specific version of ember as that is the version required for the project I'm involved with. Here is the command window output;
C:\Windows\System32>npm install -g ember-cli#1.13.13
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 graceful-fs#2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls gracef
ul-fs' to find it in the tree.
npm WARN deprecated lodash-node#2.4.1: This package has been discontinued in favor of lodash#^4.0.0.
npm WARN deprecated lodash-node#3.10.2: This package has been discontinued in favor of lodash#^4.0.0.
npm WARN deprecated cross-spawn-async#2.2.4: cross-spawn no longer requires a build toolchain, use it instead!
npm WARN deprecated socket.io-pure#1.3.12: socket.io-pure is no longer maintained as the original socket.io removed all native dependencies. Please use the original.
npm WARN deprecated lodash#2.3.0: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^4.0.0.
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 engine.io-pure#1.5.9: engine.io-purce is no longer maintained as the original engine.io removed all native dependencies. Please use the original.
npm WARN deprecated socket.io-client-pure#1.3.12: socket.io-client-pure is no longer maintained as the original socket.io removed all native dependencies. Please use the original.
npm WARN deprecated ws-pure#0.8.0: ws-pure is no longer maintained as the original ws removed all native dependencies. Please use the original ws.
npm WARN deprecated engine.io-client-pure#1.5.9: engine-io-client-pure is no longer maintained as the original engine-io-client removed all native dependencies. Please use the orig
inal.
extract:bower ▌ ╢██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
These are the installed versions of
node: v4.4.7
npm: 3.3.12
bower: 1.7.9

Resources