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

npm install failed on Raspberry Pi #1629

Closed
2 of 5 tasks
Kazuki-Nakanishi opened this issue Feb 14, 2018 · 9 comments
Closed
2 of 5 tasks

npm install failed on Raspberry Pi #1629

Kazuki-Nakanishi opened this issue Feb 14, 2018 · 9 comments

Comments

@Kazuki-Nakanishi
Copy link
Member

What are the steps to reproduce?

  1. Launch a terminal on Raspberry Pi.
  2. clone Node-RED repository from GitHub.
  3. run npm install

What happens?

Installing chromedriver failed.

What do you expect to happen?

Avoid installing chromedriver (and other related packages) when running npm install on Raspberry Pi.

Please tell us about your environment:

  • Node-RED version: 0.18.3
  • node.js version:
  • npm version:
  • Platform/OS: Raspbian OS
  • Browser:
@Kazuki-Nakanishi Kazuki-Nakanishi changed the title npm install failed on Raspberry PI npm install failed on Raspberry Pi Feb 14, 2018
@knolleary
Copy link
Member

There is no simple way to make a development dependency optional. npm chose not to add that category of dependency to the package.json format.

One option is to add an npm script for the postinstall event. That script can then check the OS and attempt an npm install of the additional packages. But this can only be done if the script is able to check whether the npm install is trying to install the development dependencies. It must not do anything for a 'normal' npm install node-red.

The other option is a similar script that is not linked to any of the npm lifecycle events that the user is expected to run manually if they want to use the chromedriver tests. This may be the right first step to resolving this. If we can automate it further later, then that is good.

@Kazuki-Nakanishi
Copy link
Member Author

@knolleary Thank you very much for your comment.

I wanted to have the dev version of optionalDependencies in package.json. This was already discussed here, and npm does not support it as of now.
npm/npm#3870

At this moment, I agree with the option that lets a user install chromedriver manually. I also need to update a design wiki.
I will send a PR for it soon.

@boneskull
Copy link
Contributor

My opinion: don't worry about it. Users installing from a working copy on a platform that doesn't support the dev dependencies can simply npm install --production to avoid installing them.

@dceejay
Copy link
Member

dceejay commented Feb 15, 2018

not really. If they install from git they need to build the project in order to get a working version... so they need the grunt tools.

@boneskull
Copy link
Contributor

ah, you're right about that. solution: use npm to install node-red instead of cloning it. 😉

@boneskull
Copy link
Contributor

so then, @Kazuki-Nakanishi Why do you need to clone the repo and install this way on your RPi? Why can't you use e.g. npm install -g node-red?

I agree running NR on an RPi is great and awesome, but I wouldn't really want a RPi as my dev environment.

@dceejay
Copy link
Member

dceejay commented Feb 15, 2018

I don't think he does particularly... he is just responding to a problem I raised that IF someone did want to do this it currently breaks (and indeed same with other architectures re that other issue) - It's only for testing the UI side - so the bulk of the existing tests work fine without it.

@Kazuki-Nakanishi
Copy link
Member Author

Hi @boneskull, Thank you for your comments.
The reason is as @dceejay explained. And one actual scenario would be that Node-RED contributors sometimes run npm install on Raspberry Pi to test their code.

@knolleary
Copy link
Member

Closing as per the merged PR above.

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

4 participants