Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Unable to run the project using 'npm start' #719

Closed
apDyn opened this issue Nov 17, 2016 · 17 comments
Closed

Unable to run the project using 'npm start' #719

apDyn opened this issue Nov 17, 2016 · 17 comments
Labels

Comments

@apDyn
Copy link

apDyn commented Nov 17, 2016

console_output.txt
I'm submitting a bug report
After changing the package json according to the webpack commit fix: cb30c75

  • Aurelia Skeleton Version
    skeleton-esnext-webpack

  • Framework Version:
    see in the included package.json

  • Operating System:
    Windows 10

  • Node Version:
    7.1.0

  • NPM Version:
    3.10.9

  • JSPM OR Webpack AND Version
    webpack 2.1.0-beta.27

  • Browser:
    all

  • Language:
    ESNext

Current behavior:
fails to run the skeleton app watching for changes

Expected/desired behavior:
runs the skeleton app and reloads on source code changes
npm-debug.log.txt

package.json.txt

@niieani
Copy link
Contributor

niieani commented Nov 17, 2016

Did you try removing node_modules and npm installing again? The CI builds successfully, so there's no reason for any such error to be present.

@apDyn
Copy link
Author

apDyn commented Nov 17, 2016

Yes, I did that.
Still same issue

On Thu, Nov 17, 2016 at 12:50 PM +0200, "Bazyli Brzóska" <[email protected]mailto:[email protected]> wrote:

Did you try removing node_modules and npm installing again? The CI builds successfully, so there's no reason for any such error to be present.

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/719#issuecomment-261216098, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMkG12EBnN3GJAvyp642v9Qepxksv65rks5q_DGBgaJpZM4K1F7u.

@niieani
Copy link
Contributor

niieani commented Nov 17, 2016

OK, I'm restarting the Windows-based CI to see if we can reproduce this error, maybe there was a breaking change in one of the dependencies. You can track https://ci.appveyor.com/project/niieani/skeleton-navigation/build/1.0.19.

@apDyn
Copy link
Author

apDyn commented Nov 17, 2016

Did review the test. However still fails to run in my local env. with the socket closed error.
Plain and simple I just followed the steps in the doc hub, with the exception of the skeleton project being downloaded straight from github with the latest commit.
Then ran:
npm install
After completion:
npm start
And keep getting the same socket closed error. I've reviewed the open ports on the machine, and no service is using port 9000.

@apDyn
Copy link
Author

apDyn commented Nov 17, 2016

bundling throws an error as well (npm run build). I've attached the console output.
bundling.txt

@niieani
Copy link
Contributor

niieani commented Nov 17, 2016

I'm not sure where to start debugging, it looks like there is some unhandled Promise rejection coming from bluebird. Can you add:

process.on("unhandledRejection", function(reason, promise) {
    console.log(reason);
});

To your webpack.config.js file and see if the output is any different?

@VitProg are you also experiencing this problem? (I see you upvoted it)

@apDyn
Copy link
Author

apDyn commented Nov 17, 2016

After adding the statement to webpack.config.babel.js npm start hangs.
Fyi I'm running it under an administrative command prompt
I've attached the output.

console2.txt

@VitProg
Copy link

VitProg commented Nov 17, 2016

@niieani
Yes. I also have a problem with the launch.

builderror.txt

@apDyn
Copy link
Author

apDyn commented Nov 17, 2016

@VitProg seems like you've already got some service running on port 9000

throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:9000

@niieani
Copy link
Contributor

niieani commented Nov 17, 2016

@apDyn seems like a problem with accessing/writing the files, perhaps permissions or something like it?:

    at Compiler.<anonymous> (C:\Dev\skeleton-navigation-master\skeleton-esnext-webpack\node_modules\html-webpack-plugin\index.js:202:15)
    at next (C:\Dev\skeleton-navigation-master\skeleton-esnext-webpack\node_modules\tapable\lib\Tapable.js:83:14)
    at callback (C:\Dev\skeleton-navigation-master\skeleton-esnext-webpack\node_modules\copy-webpack-plugin\dist\index.js:71:17)

Can you try commenting out copyFiles config part from the webpack.config and see if that helps?

@apDyn
Copy link
Author

apDyn commented Nov 17, 2016

same thing :-(
Also tried disabling the firewall, but same error.

@smithaitufe
Copy link

I just downloaded the skeleton-esnext-webpack. I did npm install and npm start. It worked great. Then I copied my codes from the previous project to this skeleton. It refused to work. Rather it is complaining about Object.assign({}, this.entity, {...response}).

client:90 ./src/sections/private/applicants/profile/profile.js
Module build failed: SyntaxError: Unexpected token (22:54)

  20 |     constructor(user, stateService, localGovernmentAreaService, termService, validationControllerFactory){
  21 |         this.user = user;
> 22 |         this.entity = Object.assign({}, this.entity, {...this.user});
     |                                                       ^
  23 |         this.stateService = stateService;
  24 |         this.localGovernmentAreaService = localGovernmentAreaService;
  25 |         this.termService = termService;

 @ ./src ^\.\/.*$
 @ ./~/aurelia-loader-webpack/dist/commonjs/aurelia-loader-webpack.js
 @ multi aureliawarnings @ client:90
client:90 ./src/sections/students/students-section.js
Module build failed: SyntaxError: Unexpected token (22:52)

  20 |   activate() {
  21 |     return this.sessionService.get_current_user()
> 22 |       .then(response => { Object.assign(this.user, {...response});
     |                                                     ^
  23 |   })
  24 |    .then(() => {
  25 |       return this.studentService.get_students(`user_id=${this.user.id}`)

Thanks for your assistance

@niieani
Copy link
Contributor

niieani commented Nov 17, 2016

@smithaitufe I think {...object} syntax is not in the babel preset as it's not es2015, seems to me you need to install/configure the appropriate babel preset/plugin for that.

As a side note, ...object syntax is (almost) the same as Object.assign, you don't really need to combine both. Just do:

this.entity = { ...this.entity, ...this.user }

@EisenbergEffect
Copy link
Contributor

Closing as question. We can continue to assist the OP here if needed afterwards.

@apDyn
Copy link
Author

apDyn commented Nov 18, 2016

Some very weird windows permissions issue, happening only in my env.
Workaround: run npm commands from the git bash, as running npm through windows command prompt or powershell denies writes to the network sockets

@mattgaspar
Copy link

FYI - The webpack error (from console_output.txt in the first post) was caused by a bug in NodeJS 7.1.0 on Windows. It was fixed last week in version 7.2.0
nodejs/node#9542

@niieani
Copy link
Contributor

niieani commented Dec 1, 2016

Thanks for investigating @mattgaspar.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants