menu

ZEIT

Our mission is to make cloud computing as easy and accessible as mobile computing. You can find our Next.js community here.

Channels
Team

Introducing `now dev` – Serverless, on localhost

April 30, 2019 at 6:58pm

Introducing `now dev` – Serverless, on localhost

April 30, 2019 at 6:58pm (Edited 11 months ago)

Today, we are excited to announce one command to run it all on localhost: now dev: Your single-command, local development environment. Read the full announcement here.

D5a80ytW0AUj-Cl.png

April 30, 2019 at 8:37pm

I'm getting this error while trying to run now dev on Windows!

Edited
  • reply
  • like
  • reply
  • like

I think some of the developers in Slack were saying Windows support isn't 100% ready yet?

  • reply
  • like

We are working on it as we speak! https://github.com/zeit/fun/pull/15/files

like-fill
2
  • reply
  • like

Ah ok thanks Paulo!

  • reply
  • like

Adding this here for anyone else having this issue! There's an issue open on the Github repo https://github.com/zeit/now-cli/issues/2282

  • reply
  • like

Seems like the "hot-reloading" for

/node on typescript doesn't fully reload when you are editing a file that your main route uses. Have to kill now dev to get it to pick up changes in related files

  • reply
  • like

Can you give me more info about your system and version of the CLI? Keep the reports coming people!

  • reply
  • like

May 1, 2019 at 11:01am

Cool in concept, however we have an app we've been building for the past couple of months on Now, its all typescript with 7 builds (2 Next, 5 Node), takes 9 minutes to start. Not practical when comparing to about 10s to start without now dev...

  • reply
  • like

Also downloaded 8.7gb worth of files to /var/folders/np/***/T/co.zeit.now/ for the one project, is this expected?

  • reply
  • like

Hi! When trying to run now dev i keeps getting EACCES: permission denied. Also try with sudo now dev, and it start to work, but after a while, i keeps getting EACCES: permission denied errors: The problem seems to be when trying to download the buildres (now@next & now@node) Any clues? :) Also, when running npm install -g now, i get this:

> Warning! Please try installing Now CLI again with the `--unsafe-perm` option.
> Example: `npm i -g --unsafe-perm now`

Could be possibly related?

Edited
  • reply
  • like

Also downloaded 8.7gb worth of files to /var/folders/np/***/T/co.zeit.now/ for the one project, is this expected?

Wow, it is not!

  • reply
  • like

Also downloaded 8.7gb worth of files to /var/folders/np/***/T/co.zeit.now/ for the one project, is this expected?

Can you give me the full details?

  • reply
  • like

Hi! When trying to run now dev i keeps getting EACCES: permission denied. Also try with sudo now dev, and it start to work, but after a while, i keeps getting EACCES: permission denied errors: The problem seems to be when trying to download the buildres (now@next & now@node) Any clues? :) Also, when running npm install -g now, i get this:

> Warning! Please try installing Now CLI again with the `--unsafe-perm` option.
> Example: `npm i -g --unsafe-perm now`

Could be possibly related?

It seems you have an NPM installation with broken permissions.

  • reply
  • like

Can you give me the full details?

What specifically would you like to know?

The actual project directory with all node_modules installed is 727mb, and this is our now.json config.

"builds": [{
"src": "package.json",
"use": "@now/node@canary"
},
{
"src": "web/next.config.js",
"use": "@now/next"
},
{
"src": "admin/next.config.js",
"use": "@now/next"
},
{
"src": "api/graphql/index.ts",
"use": "@now/node@canary",
"config": {
"maxLambdaSize": "10mb"
}
},
{
"src": "api/lambda/verify-email.ts",
"use": "@now/node@canary"
},
{
"src": "api/lambda/schedule-email.ts",
"use": "@now/node@canary"
},
{
"src": "api/lambda/booking-reminder.ts",
"use": "@now/node@canary"
}
],
"routes": [{
"src": "/verify-email",
"dest": "api/lambda/verify-email.ts"
},
{
"src": "/schedule-email",
"dest": "api/lambda/schedule-email.ts"
},
{
"src": "/booking-reminder",
"dest": "api/lambda/booking-reminder.ts"
},
{
"src": "/graphql",
"dest": "/api/graphql/index.ts"
},
{
"src": "^/admin(.*)",
"dest": "/admin$1"
},
{
"src": "^(.*)$",
"dest": "/web$1"
}
  • reply
  • like

Wow, it is not!

Is it also not expected to take around 10 minutes?

  • reply
  • like

I've manage to solve the permission issue (i can install packages globally without using sudo), but still it doesn't work:

Error! Command failed: /Users/emiliano/.npm-global/lib/node_modules/now/download/dist/now /Users/emiliano/Library/Caches/co.zeit.now/dev/builders/yarn add --exact --no-lockfile @now/build-utils@0.4.41-canary.8 @now/next @now/node
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
error An unexpected error occurred: "EACCES: permission denied, unlink '/Users/emiliano/Library/Caches/co.zeit.now/dev/builders/node_modules/@zeit/ncc/LICENSE'".

I've tried to remove package.lock.json, node_modules, but nothing. Could be because he tries to use yarn, somehow?

Edited
  • reply
  • like

Doesn't look like any environment variables from now.json are being applied in now dev. Is this expected?

  • reply
  • like

I've manage to solve the permission issue (i can install packages globally without using sudo), but still it doesn't work:

Error! Command failed: /Users/emiliano/.npm-global/lib/node_modules/now/download/dist/now /Users/emiliano/Library/Caches/co.zeit.now/dev/builders/yarn add --exact --no-lockfile @now/build-utils@0.4.41-canary.8 @now/next @now/node
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
error An unexpected error occurred: "EACCES: permission denied, unlink '/Users/emiliano/Library/Caches/co.zeit.now/dev/builders/node_modules/@zeit/ncc/LICENSE'".

I've tried to remove package.lock.json, node_modules, but nothing. Could be because he tries to use yarn, somehow?

I don't think so. Honestly, it seems you are having permissions issues and I would try to fix that in your system before using now dev.

  • reply
  • like

Doesn't look like any environment variables from now.json are being applied in now dev. Is this expected?

  • reply
  • like

What specifically would you like to know?

The actual project directory with all node_modules installed is 727mb, and this is our now.json config.

"builds": [{
"src": "package.json",
"use": "@now/node@canary"
},
{
"src": "web/next.config.js",
"use": "@now/next"
},
{
"src": "admin/next.config.js",
"use": "@now/next"
},
{
"src": "api/graphql/index.ts",
"use": "@now/node@canary",
"config": {
"maxLambdaSize": "10mb"
}
},
{
"src": "api/lambda/verify-email.ts",
"use": "@now/node@canary"
},
{
"src": "api/lambda/schedule-email.ts",
"use": "@now/node@canary"
},
{
"src": "api/lambda/booking-reminder.ts",
"use": "@now/node@canary"
}
],
"routes": [{
"src": "/verify-email",
"dest": "api/lambda/verify-email.ts"
},
{
"src": "/schedule-email",
"dest": "api/lambda/schedule-email.ts"
},
{
"src": "/booking-reminder",
"dest": "api/lambda/booking-reminder.ts"
},
{
"src": "/graphql",
"dest": "/api/graphql/index.ts"
},
{
"src": "^/admin(.*)",
"dest": "/admin$1"
},
{
"src": "^(.*)$",
"dest": "/web$1"
}

Can you make a new issue in https://github.com/zeit/now-cli/issues with all the details? It seems you have a fairly complex setup and we would love to see your feedback there.

  • reply
  • like

Can you elaborate? I've got env variables set in now.json under env and build keys, in .env and .env.build. None of them are present in the now dev environment. I can't pass -e args to the now dev command.

Edited
  • reply
  • like
Show more messages