Next.js: sh: next: not found

Created on 10 Aug 2017  Â·  3Comments  Â·  Source: vercel/next.js

When trying to Deploy with $now i run in to following and i don't know how to solve it, logs don't give me any other information.

sh: next: not found
Synced 3 files (651.94kB) [10s]
Initializing…
Building
â–² npm install
✓ Using "package-lock.json"
⧗ Installing 42 main dependencies…
✓ Installed 1648 modules [2m]
â–² npm run build

*@0.1.0 build /home/nowuser/src
next build
sh: next: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

Package.json

{
  "name": "**",
  "version": "0.1.0",
  "description": "Web app",
  "author": "Mathias <[email protected]>",
  "license": "ISC",
  "repository": "",
  "main": "index.js",
  "dependencies": {
    "axios": "^0.16.2",
    "babel-plugin-wrap-in-js": "^1.1.1",
    "body-parser": "^1.17.2",
    "cookie": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
    "dotenv": "^4.0.0",
    "express": "^4.15.4",
    "express-session": "^1.15.5",
    "firebase": "^4.2.0",
    "firebase-admin": "^5.1.0",
    "firebaseui": "^2.3.0",
    "isomorphic-unfetch": "^2.0.0",
    "js-cookie": "^2.1.4",
    "lusca": "^1.5.0",
    "next": "^3.0.3",
    "next-redux-wrapper": "^1.3.2",
    "node-sass": "^4.5.3",
    "nodemailer": "^4.0.1",
    "now-logs": "0.0.7",
    "orm": "^3.2.4",
    "raw-loader": "^0.5.1",
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "react-jplayer": "^5.0.4",
    "react-redux": "^5.0.6",
    "redux": "^3.7.2",
    "redux-thunk": "^2.2.0",
    "sass-loader": "^6.0.6",
    "session-file-store": "^1.1.2",
    "sqlite3": "^3.1.9",
    "styled-jsx": "^1.0.10",
    "uuid": "^3.1.0",
    "webpack": "^2.5.1"
  },
  "devDependencies": {
    "babel-eslint": "^7.2.3",
    "eslint": "^4.4.1",
    "eslint-config-airbnb": "^15.1.0",
    "eslint-config-xo": "^0.18.2",
    "eslint-config-xo-react": "^0.13.0",
    "eslint-config-xo-space": "^0.16.0",
    "eslint-plugin-jsx-a11y": "5.1.1",
    "eslint-plugin-react": "^7.2.0",
    "sass-lint": "^1.10.2",
    "xo": "^0.18.2"
  },
  "scripts": {
    "dev": "node server.js",
    "build": "next build",
    "start": "NODE_ENV=production node server.js"
  },
  "engines": {
    "node": "8.x.x"
  }
}

Most helpful comment

I found a solution, hopefully it works for you also:
your trace error has "Using "package-lock.json". is this file up to date? I use yarn so i deleted package-lock.json and now it works

All 3 comments

try removing
"main": "index.js",

I found a solution, hopefully it works for you also:
your trace error has "Using "package-lock.json". is this file up to date? I use yarn so i deleted package-lock.json and now it works

I had the same error "sh: next: not found"
Had to update node from v6 to v8. Hope it helps!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lixiaoyan picture lixiaoyan  Â·  3Comments

havefive picture havefive  Â·  3Comments

olifante picture olifante  Â·  3Comments

sospedra picture sospedra  Â·  3Comments

knipferrc picture knipferrc  Â·  3Comments