geeksessions / geeksessions.io

website repo for Geek Session Faro
https://geeksessions.io
10 stars 7 forks source link

Error running project locally - "Your codebase isn’t linked to a project on ZEIT Now" #29

Closed Painatalman closed 3 years ago

Painatalman commented 4 years ago

I tried to run the app locally (with now dev), but I got this error:

Now CLI 18.0.0 dev (beta) — https://zeit.co/feedback
Error! Your codebase isn’t linked to a project on ZEIT Now. Run `now` to link it.

Running the 'now' command, on the other hand, asks me for a login, but am I supposed to have an account to run the project locally?

Steps to reproduce

In the root project folder:

  1. run npm install
  2. run npm install -g now
  3. run now dev
  4. (after getting the error) run now

Installed software and packages

Possible Solution

Replacing now version 18.0 with its version 16.7.3 seems to solve the issue:

npm install now@16 -g

Check this reply to Now issue 3767 for details.

Suggestions

I suggest we either:

  1. specify the now version to install globally on the project setup
  2. set now as a dev dependency and ** add an npm command in package.json:
    "scripts": {
        "dev": "now dev"
    },
    "devDependencies": {
        "now": "16.7.3"        
    }

Personally, I prefer the second option, as it removes the need for a global dependency.

Painatalman commented 4 years ago

Since we can't set now dev as the dev script for package.json, we can define a custom script called now:

"scripts": {
        "now": "now dev"
    }
mcoquet commented 3 years ago

@Painatalman Sorry for the enormous delay 🙏 Instead of your solution, can you try simply running npm run dev ? It should be able to run a localhost version without needing to install now or anything else globally.

Painatalman commented 3 years ago

@mcoquet I can confirm I can run the project "now" (pun intended). Closing the issue.