Report this

What is the reason for this report?

After running npm install installs with no errors, node_modules is empty

Posted on January 16, 2017

I am looking to move my react app over to a DO droplet and I came across this well written tutorial by scotch.io (https://scotch.io/tutorials/how-to-host-a-node-js-app-on-digital-ocean). After I clone my repo and run ‘sudo npm install’, all goes well with no errors. However when looking in the node_modules folder, nothing is there. This results in missing module errors when running express server and webpack build. Has anyone run across this issue?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@lsbyerley

Have you checked your package.json file to verify whether or not the projects’ dependencies have been saved, thus allowing npm to pull them down when you run npm install?

this is my package.json file used when running npm install. The first error I see when trying to run my build is Error: Cannot find module ‘del’

{
  "name": "my-react-spa",
  "version": "1.0.0",
  "main": "server.js",
  "description": "--",
  "scripts": {
    "start": "gulp"
  },
  "author": "--",
  "license": "ISC",
  "dependencies": {
    "axios": "^0.15.3",
    "cheerio": "^0.22.0",
    "ejs": "^2.5.1",
    "express": "^4.13.4",
    "json-server": "^0.9.2",
    "lodash": "^4.14.0",
    "moment": "^2.14.1",
    "react": "^15.0.1",
    "react-addons-css-transition-group": "^15.4.1",
    "react-bootstrap": "^0.30.7",
    "react-dom": "^15.0.1",
    "react-fontawesome": "^1.1.0",
    "react-helmet": "^3.2.2",
    "react-redux": "^4.4.1",
    "react-router": "3.0.0",
    "react-tweet": "^1.0.22",
    "redux": "^3.3.1",
    "request": "^2.74.0",
    "scrollreveal": "^3.2.0",
    "twitter": "^1.3.0"
  },
  "devDependencies": {
    "autoprefixer": "^6.5.3",
    "babel-cli": "^6.18.0",
    "babel-core": "^6.18.2",
    "babel-loader": "^6.2.7",
    "babel-preset-es2015": "^6.18.0",
    "babel-preset-react": "^6.16.0",
    "babel-preset-stage-2": "^6.18.0",
    "css-loader": "^0.26.0",
    "del": "^2.2.0",
    "extract-text-webpack-plugin": "^1.0.1",
    "gulp": "^3.9.1",
    "gulp-nodemon": "^2.2.1",
    "gulp-rename": "^1.2.2",
    "node-sass": "^3.13.0",
    "postcss": "^5.2.5",
    "postcss-loader": "^1.1.1",
    "precss": "^1.4.0",
    "sass-loader": "^4.0.2",
    "style-loader": "^0.13.1",
    "webpack": "^1.13.3",
    "webpack-stream": "^3.1.0"
  }
}

Update: Did not seem to do the trick. Was in my local terminal when i ran the cache clean, thinking it worked. However, upon running it in the droplet terminal, no luck.

Not if this will help, but here is a screenshot of the install… http://imgur.com/TBGXraH

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.