Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not run #1618

Closed
aiyadingya opened this issue Apr 7, 2018 · 3 comments
Closed

Can not run #1618

aiyadingya opened this issue Apr 7, 2018 · 3 comments

Comments

@aiyadingya
Copy link

MacBook Pro (Retina, 13-inch, Early 2015)
node v8.9.1
npm v5.7.1

After running the npm start command, the following result appears:

aiyadingyadeMacBook-Pro:nodejs.org aiyadingya$ npm run start

> nodejs.org@ start /Users/aiyadingya/www/code/nodejs.org
> npm run serve


> nodejs.org@ serve /Users/aiyadingya/www/code/nodejs.org
> node server.js

[metalsmith] build/static started
[metalsmith] build/layouts started
http://localhost:8080/en/
[metalsmith] build/static finished: 136.254ms
[metalsmith] build/layouts finished: 1118.556ms
releases undefined
/Users/aiyadingya/www/code/nodejs.org/scripts/helpers/latestversion.js:15
  const match = releases.find((release) => !release.lts && semver.gte(release.version, '5.0.0'))
                         ^

TypeError: Cannot read property 'find' of undefined
    at Object.exports.current (/Users/aiyadingya/www/code/nodejs.org/scripts/helpers/latestversion.js:15:26)
    at loadVersions (/Users/aiyadingya/www/code/nodejs.org/build.js:268:34)
    at afterFetch (/Users/aiyadingya/www/code/nodejs.org/node_modules/node-version-data/node-version-data.js:46:14)
    at proxy (/Users/aiyadingya/www/code/nodejs.org/node_modules/node-version-data/node_modules/after/index.js:19:13)
    at /Users/aiyadingya/www/code/nodejs.org/node_modules/node-version-data/node-version-data.js:32:14
    at BufferList._callback (/Users/aiyadingya/www/code/nodejs.org/node_modules/node-version-data/node_modules/jsonist/jsonist.js:32:16)
    at BufferList.<anonymous> (/Users/aiyadingya/www/code/nodejs.org/node_modules/node-version-data/node_modules/bl/bl.js:16:14)
    at emitOne (events.js:116:13)
    at DestroyableTransform.emit (events.js:211:7)
    at ClientRequest.<anonymous> (/Users/aiyadingya/www/code/nodejs.org/node_modules/node-version-data/node_modules/hyperquest/index.js:13:19)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:387:9)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodejs.org@ serve: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejs.org@ serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aiyadingya/.npm/_logs/2018-04-07T10_16_15_864Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodejs.org@ start: `npm run serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejs.org@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aiyadingya/.npm/_logs/2018-04-07T10_16_15_904Z-debug.log
aiyadingyadeMacBook-Pro:nodejs.org aiyadingya$

and I open http://localhost:8080/en/ Show this page not found

@Knighton910
Copy link
Contributor

@aiyadingya could you give more information about what you're trying to do & sources you are following to get the result you want.

fhemberger added a commit that referenced this issue Apr 8, 2018
In case `versions.json` could not be properly downloaded/parsed by
'node-version-data', avoid `TypeError: Cannot read property 'find' of undefined`
when `releases` is `undefined` and return `undefined` instead.

Error should be handled properly elsewhere.

See: #1618
@fhemberger
Copy link
Contributor

fhemberger commented Apr 8, 2018

Hi, I just checked out fresh copy of this repository and tried to build it. Worked fine for me. Could you please check if source/versions.json exists? If so: Is there maybe a firewall rule that prevents Node.js from downloading that file?

Somehow the array of Node.js versions is undefined in your case, that's why the build script throws at this point. While I can't reproduce this issue myself, I created a PR to fix the build breaking at that point. Once it's merged, it would be nice if you could update your local copy and try again.

fhemberger added a commit that referenced this issue Apr 8, 2018
In case `versions.json` could not be properly downloaded/parsed by
'node-version-data', avoid `TypeError: Cannot read property 'find' of undefined`
when `releases` is `undefined` and return `undefined` instead.

Error should be handled properly elsewhere.

See: #1618
@fhemberger
Copy link
Contributor

No answer from original poster, closing.

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

No branches or pull requests

3 participants