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

Cannot npm install from github #382

Closed
matt1as opened this issue Dec 12, 2016 · 12 comments
Closed

Cannot npm install from github #382

matt1as opened this issue Dec 12, 2016 · 12 comments

Comments

@matt1as
Copy link

matt1as commented Dec 12, 2016

The current version on github version does not install via npm install

root@2cc7a4204924:/usr/src# npm install git+https://github.com/zeit/next.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN Bryderi@ No repository field.
npm WARN Bryderi@ No license field.
npm ERR! Linux 4.4.27-moby
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "git+https://github.com/zeit/next.js"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! path /usr/src/node_modules/next/dist/bin/next
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/src/node_modules/next/dist/bin/next'
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/src/node_modules/next/dist/bin/next'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/npm-debug.log

@chiefjester
Copy link

chiefjester commented Dec 13, 2016

@matt1as this is not a bug, the reason why its failing is the compiled version is built and is not included in git, namely dist folder.

There are many reasons for not including the compiled version, but since the authors opted not to include it then this is just meant to consume in npm.

@arunoda
Copy link
Contributor

arunoda commented Dec 13, 2016

This is a legit usecase, specially when trying out unmerged PRs.
But, this makes code reviewing difficult.

We've two options here:

  1. Add the dist directory to GIT
  2. Write a postInstall npm script to build the dist if it's not there.

I think option 2 is a good idea, but we need to deal with some other issues.

@rauchg @nkzawa What do you guys think?

@nkzawa
Copy link
Contributor

nkzawa commented Dec 13, 2016

Write a postInstall npm script to build the dist if it's not there.

To make this work, you have to install devDependencies too, which I think would be troublesome.

I wonder if we can just recommend to use npm link to test PRs or the master.
If you'd like to use it in production, you can add dist to Git in your forked repository.

@arunoda
Copy link
Contributor

arunoda commented Dec 13, 2016

To make this work, you have to install devDependencies too, which I think would be troublesome.

Yeah. I got that. It's doable, but it's questionable whether we need to do it or not.

I wonder if we can just recommend to use npm link to test PRs or the master.
If you'd like to use it in production, you can add dist to Git in your forked repository.

This is good. We need to add it.

@chiefjester
Copy link

so what the verdict here? just add a readme for npm link? @arunoda / @nkzawa ?

@aesopwolf
Copy link

I'm not sure if npm link will work. The next server boots, but then displays the following error on the html page itself:

Error in ./pages/index.js?entry
Module build failed: Error: Couldn't find preset "es2015" relative to directory "/Users/aesopwolf/Documents/web-registration/pages"
    at /Users/aesopwolf/Documents/next.js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:299:19
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/aesopwolf/Documents/next.js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:270:20)
    at OptionManager.mergePresets (/Users/aesopwolf/Documents/next.js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:259:10)
    at OptionManager.mergeOptions (/Users/aesopwolf/Documents/next.js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:244:14)
    at OptionManager.init (/Users/aesopwolf/Documents/next.js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:374:12)
    at File.initOptions (/Users/aesopwolf/Documents/next.js/node_modules/babel-core/lib/transformation/file/index.js:216:65)
    at new File (/Users/aesopwolf/Documents/next.js/node_modules/babel-core/lib/transformation/file/index.js:139:24)
    at Pipeline.transform (/Users/aesopwolf/Documents/next.js/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (/Users/aesopwolf/Documents/next.js/node_modules/babel-loader/lib/index.js:41:20)

I have my project web-registration and the next.js folder sitting parallel to each other in my Documents folder. Is there a better way to do this? Do I have to put my next.js fork into my project folder itself? That seems kind of weird.

@matt1as
Copy link
Author

matt1as commented Dec 15, 2016

If I do npm link on my host machine, running osX, everything works fine. If I do npm link in my Docker container I get the same behaviour as trying to install from github directly

root@1294c7041597:/usr/src# git clone https://github.com/zeit/next.js.git
root@1294c7041597:/usr/src# link next.js
...
... Lots of packages installing
...

npm info linkStuff next@1.2.3
npm ERR! Linux 4.4.27-moby
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "link" "next.js/"
npm ERR! node v5.2.0
npm ERR! npm v3.3.12
npm ERR! path /usr/local/lib/node_modules/next/dist/bin/next
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/next/dist/bin/next'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/npm-debug.log

I'm running the stock node/5.2 docker image

web:
image: node:5.2
ports:
- "3000:3000"
- "3030:3030"
volumes:
- ./client:/usr/src/:rw
# - /usr/src/node_modules
command:
npm run dev
working_dir:
/usr/src

@eric-burel
Copy link
Contributor

Hi,

This issue is tricky, because the README on the master introduces interesting functionnalities that do not seem to exist in the lastest stable release.
Therefore the reflex to enjoy them is to track the master branch in npm, and then we obtain this issue with fsevents, which is quite unclear.

In the end, what's the best way to track the master branch ? Could it be documented ?

@timneutkens
Copy link
Member

We're working on master released as next@beta. Stable will be 🔜 when all crical bugs have been resolved.

@eric-burel
Copy link
Contributor

Amazing, thank you! Indeed that's be great to get this documented. I guess many users do not use Next for its stability but indeed want the beta features, at least for now. And this would prevent most people from encountering this issue.

@timneutkens
Copy link
Member

@eric-burel fair point: *NOTE! the README on the master branch might not match that of the latest stable release! * doesn't cover next@beta

@timneutkens
Copy link
Member

timneutkens commented Feb 17, 2017

Closing this in favor of #303. Which will allow us to publish beta after every PR merge.

@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants