Skip to content

ERROR when using 'ng serve' with a ./config/environment.js path #3531

Closed
@bdphil86

Description

@bdphil86

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.22-1
node: 7.2.0
os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

No. This app was created using the CLI.
I added a 'config' directory to the root of my application with an 'environment.js' file inside. I use this file from 'server.js' to set env variable in my express app.

The log given by the failure.

Normally this include a stack trace and some more information.

C:\Users\brand\Desktop\projects\ng2-skeleton-node>ng serve
app.set is not a function
TypeError: app.set is not a function
at module.exports.app (C:\Users\brand\Desktop\projects\ng2-skeleton-node\config\environment.js:2:7)
at Project.config (C:\Users\brand\Desktop\projects\ng2-skeleton-node\node_modules\angular-cli\angular-cli\lib\models\project.js:198:52)
at C:\Users\brand\Desktop\projects\ng2-skeleton-node\node_modules\angular-cli\commands\serve.js:95:40
at process._tickCallback (internal/process/next_tick.js:103:7)

Mention any other details that might be useful.

I renamed folder to 'configuration' and updated my references; this corrected the issue.


Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions