Skip to content

On lesson 'https://frontendmasters.com/courses/api-design-nodejs-v3/creating-a-document/' #82

@007oscar

Description

@007oscar

I am traying to execute node item.controllers.js
and throws error:

`D:\CURSOS\FRONTEND MASTERS\API DESIGN IN NODE.JS\api-design-node-v3\src\resources\item\item.controllers.js:2
import { Item } from './item.model'
^^^^^^

SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:988:16)
at Module._compile (internal/modules/cjs/loader.js:1036:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47`

I tried putting type: module on package.json without success, also trying to run it from 'dist' folder, please somebody can help me.

My current node version is v14.17.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions